Issues Making Flash Partition for Bootloader and Main Program

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Issues Making Flash Partition for Bootloader and Main Program

837 次查看
nick_schneider
Contributor II

I am attempting to create two partitions of flash, one for a future bootloader and another for the main program. 

I set the bootloader to be from 0x0 to 0x6000 and the main partition to be from 0x6000 to 0x20000 as seen in the image below.

MCU Settings.JPG

I don't really have a bootloader at this point but instead I attempt to place the file startup_mkl16z4 in the bootloader partition so the system can startup correctly. Note that I have "Enable automatic placement of flash..." selected at this point. 

nick_schneider_1-1680709846128.jpeg

 

When I do this and compile I get an error that says "Linker Flash Config Support Enabled, but no .FlashConfig section provided within application". To prevent that error I placed a flash config table (copied from startup_mkl16z4) at the top of main thinking that a flash config section needed to be in each partition of memory since there is already one in bootloader section because of the startup file. This prevents the compile error.  

nick_schneider_2-1680710006651.jpeg

 

When I load the software with this configuration it does not work. When I view the memory through the debugger it appears that the flash config table is being placed at the very beginning of the flash instead of the vector table and I am not sure why. 

nick_schneider_3-1680710183289.jpeg

 

I have found that I can get the program to run if I remove the flash config table before main and deselect the option "Enable automatic placement of flash..." in the managed linker script.

 

My questions are:

Why exactly am I having this experience with the flash config table being placed at the beginning of flash?

I assume I do not want to have a second flash config table above main and do not want to disable the automatic placement of it, so what should I be doing instead to get the vector table and everything else to align properly?

 

I have attached my startup_mkl16z4.c (should be unchanged from default) file and my linker file with "Enable automatic placement of flash..." checked. Let me know if there is anything else I can provide to help get this answered.

标签 (1)
0 项奖励
回复
1 回复

778 次查看
CarlosGarabito
NXP TechSupport
NXP TechSupport
0 项奖励
回复