cx2538_setup.c 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //*****************************************************************************
  2. //! @file cx2538_setup.c
  3. //! @brief Setup code for CC2538 for use with IAR EWARM.
  4. //!
  5. //! Revised $Date: 2013-04-29 14:48:18 +0200 (ma, 29 apr 2013) $
  6. //! Revision $Revision: 9929 $
  7. //
  8. // Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  9. //
  10. //
  11. // Redistribution and use in source and binary forms, with or without
  12. // modification, are permitted provided that the following conditions
  13. // are met:
  14. //
  15. // Redistributions of source code must retain the above copyright
  16. // notice, this list of conditions and the following disclaimer.
  17. //
  18. // Redistributions in binary form must reproduce the above copyright
  19. // notice, this list of conditions and the following disclaimer in the
  20. // documentation and/or other materials provided with the distribution.
  21. //
  22. // Neither the name of Texas Instruments Incorporated nor the names of
  23. // its contributors may be used to endorse or promote products derived
  24. // from this software without specific prior written permission.
  25. //
  26. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  27. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  28. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  29. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  30. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  31. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  32. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  33. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  34. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  35. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  36. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. //****************************************************************************/
  38. #include <stdint.h>
  39. #define FLASH_START_ADDR 0x00200000
  40. #define BOOTLOADER_BACKDOOR_DISABLE 0xEFFFFFFF
  41. //*****************************************************************************
  42. //
  43. // Customer Configuration Area in Lock Page
  44. // Holds Image Vector table address (bytes 2013 - 2015) and
  45. // Image Valid bytes (bytes 2008 -2011)
  46. //
  47. //*****************************************************************************
  48. typedef struct
  49. {
  50. uint32_t ui32BootldrCfg;
  51. uint32_t ui32ImageValid;
  52. uint32_t ui32ImageVectorAddr;
  53. }
  54. lockPageCCA_t;
  55. #ifdef __IAR_SYSTEMS_ICC__
  56. __root const lockPageCCA_t __cca @ ".flashcca" =
  57. #elif __TI_COMPILER_VERSION__
  58. #pragma DATA_SECTION(__cca, ".flashcca")
  59. #pragma RETAIN(__cca)
  60. const lockPageCCA_t __cca =
  61. #else
  62. __attribute__ ((section(".flashcca"), used))
  63. const lockPageCCA_t __cca =
  64. #endif
  65. {
  66. BOOTLOADER_BACKDOOR_DISABLE, // Bootloader backdoor disabled
  67. 0, // Image valid bytes
  68. FLASH_START_ADDR // Vector table located at flash start address
  69. };