Cannot Write to Flash in program Code Portion of Flash

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot Write to Flash in program Code Portion of Flash

1,161 Views
JimMcP
Contributor I
I have a bootloader running in the  first 12K  (0x00003000) of flash.  From  flash  address  0x00003000  and  on  the program  code runs. The bootloader is in its own project.

The bootloader does the flash update process and reboots into the program code. But I cannot write to flash in my Program code. The CFM configuration field seems it has not been initialized in the program code. How can I initialized it..

Code:
// LCF fileMEMORY   // Flash starts at 0x00003000... boot loader occupies first 12k of flash{     vectorflash (RX) : ORIGIN = 0x00003000,  LENGTH = 0x0000040C     flashconfig (RX) : ORIGIN = 0X0000340C,  LENGTH = 0x00000018          flash0 (RX) : ORIGIN = 0x00003424,  LENGTH = 0x00000BDC    flash (RX) : ORIGIN = 0x00004000,  LENGTH = 0x0003EF80     params  (RX) : ORIGIN = 0x0003FF80,  LENGTH = 0x00000080 //128 bytes  vectorram (RW) : ORIGIN = 0x20000000,  LENGTH = 0x00000400      ram     (RW) : ORIGIN = 0x20000400,  LENGTH = 0x00007C00 }SECTIONS {    ___IPSBAR           = 0x40000000;    ___SRAM             = 0x20000000;    ___SRAM_SIZE        = (32 * 1024);    ___FLASH            = ADDR(vectorflash);##  ___FLASH_SIZE       = (255 * 1024) + (7*128);    ___FLASH_SIZE       = (243 * 1024) + (7*128); ___PC_INIT   = ADDR(vectorflash) + 0x400;    ___RWFLASH            = ADDR(params);    ___RWFLASH_SIZE       = (1 * 128);     ___VECTOR_RAM       = ___SRAM;        ___FLASH_CONFIG     = ADDR(flashconfig);       .vectorflash :    {     vectors.s (.text)     } > vectorflash        .flashconfig :    {     flash_config.s (.text)     } > flashconfig............................/* * File: flash_config.s */ .global FLASH_CONFIG .global _FLASH_CONFIG  .text/* * FLASH configuration */FLASH_CONFIG:_FLASH_CONFIG:.long 0x00000000 .long 0x00000000.long 0x00000000.long 0x00000000.long 0x00000000.long 0x00000000.end

 





Labels (1)
0 Kudos
1 Reply

143 Views
JimMcP
Contributor I
Fixed the problem. Change my bootloader to occupy the first 16K of flash instead of 12K.

0 Kudos