I am developing software for the STR912FAW44 using the IAR Embedded Workbench version 5.50.5. I am facing a problem when the code size exceeds about 64K. The code does not execute from the flash. The same code works when I debug it using a the J-Link debugger. But when I download it using the J-Link debugger it doesn’t work. I tried both the builds i.e. debug and release. The only difference between these 2 is that the “DEBUG” is defined in the debug build and NOT in the release build.
I have set the bank 0 as a boot bank and don’t have a boot loader. I believe the debugger downloads the code to the bank 0. The bank 0 address is set as 0x0000. If I comment out some code it works. I observed the code size ( Code and Read only data) in the map file and observed that the code doesn’t work if the size exceeds about 64K. The STR912FAW44 has 512K bytes of flash in the bank 0 and it’s divided into 8 sectors. Each sector is 64K. I have different licensed dongles and tried with them .
Is there any issue in downloading the code or building it if the code size crosses the first sector boundary?
I use the FreeRTOS ver 7.0.1 and use the initialization files 91x_init.s and 91x_vect.s come with that. I use the heap_2.c implementation from the FreeRTOS for heap. It allocates the heap as a fixed size array. Also, I have 2 projects:
1. FreeRTOS project is built as a library using “C” complier and
2. The application project built as an executable with the “Embedded C++” compiler option.
The Flash memory configuration used is:
FMI_BankRemapConfig(4, 2, 0, 0x80000 ); /* FMI_BootBankSize, FMI_NonBootBankSize, FMI_BootBankAddress, FMI_NonBootBankAddress */
FMI_Config( FMI_READ_WAIT_STATE_2, FMI_WRITE_WAIT_STATE_0, FMI_PWD_ENABLE, FMI_LVD_ENABLE, FMI_FREQ_HIGH );
Thanks for the help you provide.