DSP2803x_CodeStartBranch.asm 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ;//###########################################################################
  2. ;//
  3. ;// FILE: DSP2803x_CodeStartBranch.asm
  4. ;//
  5. ;// TITLE: Branch for redirecting code execution after boot.
  6. ;//
  7. ;// For these examples, code_start is the first code that is executed after
  8. ;// exiting the boot ROM code.
  9. ;//
  10. ;// The codestart section in the linker cmd file is used to physically place
  11. ;// this code at the correct memory location. This section should be placed
  12. ;// at the location the BOOT ROM will re-direct the code to. For example,
  13. ;// for boot to FLASH this code will be located at 0x3f7ff6.
  14. ;//
  15. ;// In addition, the example DSP2803x projects are setup such that the codegen
  16. ;// entry point is also set to the code_start label. This is done by linker
  17. ;// option -e in the project build options. When the debugger loads the code,
  18. ;// it will automatically set the PC to the "entry point" address indicated by
  19. ;// the -e linker option. In this case the debugger is simply assigning the PC,
  20. ;// it is not the same as a full reset of the device.
  21. ;//
  22. ;// The compiler may warn that the entry point for the project is other then
  23. ;// _c_init00. _c_init00 is the C environment setup and is run before
  24. ;// main() is entered. The code_start code will re-direct the execution
  25. ;// to _c_init00 and thus there is no worry and this warning can be ignored.
  26. ;//
  27. ;//###########################################################################
  28. ;// $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  29. ;// $Release Date: May 8, 2015 $
  30. ;// $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  31. ;// http://www.ti.com/ ALL RIGHTS RESERVED $
  32. ;//###########################################################################
  33. ***********************************************************************
  34. WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0
  35. .ref _c_int00
  36. .global code_start
  37. ***********************************************************************
  38. * Function: codestart section
  39. *
  40. * Description: Branch to code starting point
  41. ***********************************************************************
  42. .sect "codestart"
  43. code_start:
  44. .if WD_DISABLE == 1
  45. LB wd_disable ;Branch to watchdog disable code
  46. .else
  47. LB _c_int00 ;Branch to start of boot.asm in RTS library
  48. .endif
  49. ;end codestart section
  50. ***********************************************************************
  51. * Function: wd_disable
  52. *
  53. * Description: Disables the watchdog timer
  54. ***********************************************************************
  55. .if WD_DISABLE == 1
  56. .text
  57. wd_disable:
  58. SETC OBJMODE ;Set OBJMODE for 28x object code
  59. EALLOW ;Enable EALLOW protected register access
  60. MOVZ DP, #7029h>>6 ;Set data page for WDCR register
  61. MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
  62. EDIS ;Disable EALLOW protected register access
  63. LB _c_int00 ;Branch to start of boot.asm in RTS library
  64. .endif
  65. ;end wd_disable
  66. .end
  67. ;//===========================================================================
  68. ;// End of file.
  69. ;//===========================================================================