debug problem with mk02

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

debug problem with mk02

跳至解决方案
1,353 次查看
jackxu
Contributor III

Hi there,

After build my new project, there come a error shows in the following pic

pastedImage_1.png

pastedImage_2.png

Is there any one can help?

Thanks in advance!

-Jack

1 解答
1,194 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Jack Xu

You are getting the "section .bss will not fit in region m_data" error. This error is caused when you have a large number of uninitialized data, which will be contained in RAM. You need to check the RAM size of your device (I don't remember it, I think is 16 KB) and then you need to keep your number of variable in the minimum in order to accomplish that `m_data' is NOT overflowed by 5192 bytes.

I recommend you to check the following link: https://mcuoneclipse.com/2013/04/14/text-data-and-bss-code-and-data-size-explained/  Here he explains what is .bss and data size. After this you could check this general recommendations of how to work with SDK 2.0 and the size limitation: https://mcuoneclipse.com/2016/03/09/dealing-with-code-size-in-kinetis-sdk-v2-x-projects/ 

Also I recommend you to check these link and document, where another customer had a similar case and they explain how to manipulate linker file to work with the full available size:

RAM Usage with KDS+KSDK: report 20% used and region overflow 

Relocating Code and Data Using the KDS GCC Linker File for Kinetis 

Hope this information could help you, please tell me if you have additional questions of this

Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

5 回复数
1,194 次查看
jackxu
Contributor III

Hi Jorge Alcala,

Thanks for your attention. I've built two new empty project to test the error. Steps as following

pastedImage_2.png

pastedImage_3.png

pastedImage_4.png

pastedImage_5.png

pastedImage_6.png

pastedImage_7.png

pastedImage_8.png

pastedImage_9.png

pastedImage_10.png

0 项奖励
回复
1,194 次查看
jackxu
Contributor III

As the two is new empty project, so i do not think it's about the ram even through MK02 only gets 16K RAM.

Thanks in advance!

-Jack

0 项奖励
回复
1,194 次查看
jackxu
Contributor III

Hi Jorge Alcala,

Thanks for your advice, I built the project using KSDK 2.x.  Board.c is clean, but i defined in board.h

pastedImage_1.png

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T "../MK02FN64xxx10_flash.ld" -Xlinker --gc-sections -Wl,-Map,"****************.map" -specs=nosys.specs -specs=nano.specs -Xlinker -z -Xlinker muldefs -o "**********************.elf" ./utilities/fsl_debug_console.o ./utilities/fsl_notifier.o ./utilities/fsl_sbrk.o ./startup/startup_MK02F12810.o ./startup/system_MK02F12810.o ./source/main.o ./freertos/Source/portable/MemMang/heap_4.o ./freertos/Source/portable/GCC/ARM_CM4F/port.o ./freertos/Source/croutine.o ./freertos/Source/event_groups.o ./freertos/Source/list.o ./freertos/Source/queue.o ./freertos/Source/tasks.o ./freertos/Source/timers.o ./drivers/fsl_adc16.o ./drivers/fsl_clock.o ./drivers/fsl_cmp.o ./drivers/fsl_common.o ./drivers/fsl_crc.o ./drivers/fsl_dac.o ./drivers/fsl_dmamux.o ./drivers/fsl_dspi.o ./drivers/fsl_dspi_edma.o ./drivers/fsl_edma.o ./drivers/fsl_ewm.o ./drivers/fsl_flash.o ./drivers/fsl_ftm.o ./drivers/fsl_gpio.o ./drivers/fsl_i2c.o ./drivers/fsl_i2c_edma.o ./drivers/fsl_llwu.o ./drivers/fsl_lptmr.o ./drivers/fsl_pdb.o ./drivers/fsl_pit.o ./drivers/fsl_pmc.o ./drivers/fsl_rcm.o ./drivers/fsl_sim.o ./drivers/fsl_smc.o ./drivers/fsl_uart.o ./drivers/fsl_uart_edma.o ./drivers/fsl_vref.o ./drivers/fsl_wdog.o ./board/board.o ./board/clock_config.o ./board/pin_mux.o

d:/freescale/kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: ***********.elf section `.bss' will not fit in region `m_data'

d:/freescale/kds_v3/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: region `m_data' overflowed by 5192 bytes

pastedImage_2.png

pastedImage_1.png

Regards

Jack

0 项奖励
回复
1,195 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Jack Xu

You are getting the "section .bss will not fit in region m_data" error. This error is caused when you have a large number of uninitialized data, which will be contained in RAM. You need to check the RAM size of your device (I don't remember it, I think is 16 KB) and then you need to keep your number of variable in the minimum in order to accomplish that `m_data' is NOT overflowed by 5192 bytes.

I recommend you to check the following link: https://mcuoneclipse.com/2013/04/14/text-data-and-bss-code-and-data-size-explained/  Here he explains what is .bss and data size. After this you could check this general recommendations of how to work with SDK 2.0 and the size limitation: https://mcuoneclipse.com/2016/03/09/dealing-with-code-size-in-kinetis-sdk-v2-x-projects/ 

Also I recommend you to check these link and document, where another customer had a similar case and they explain how to manipulate linker file to work with the full available size:

RAM Usage with KDS+KSDK: report 20% used and region overflow 

Relocating Code and Data Using the KDS GCC Linker File for Kinetis 

Hope this information could help you, please tell me if you have additional questions of this

Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,194 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Jack Xu

Are you using KSDK 1.x or 2.0? you said that you build you "new project", do you based your project in other example code?

This could be a header files problem or a renamed project problem. Could you share what you get in your "problems windows"? Please verify that you are properly including your headers in the board.c and the board.h files, then apply a "clean project" (with right clik->clean project) and then rebuild it.

Hope this information helps, please tell me if you have any problem
Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复