Hi there,
After build my new project, there come a error shows in the following pic
Is there any one can help?
Thanks in advance!
-Jack
Solved! Go to Solution.
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!
-----------------------------------------------------------------------------------------------------------------------
Hi Jorge Alcala,
Thanks for your attention. I've built two new empty project to test the error. Steps as following
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
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
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
Regards
Jack
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!
-----------------------------------------------------------------------------------------------------------------------
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!
-----------------------------------------------------------------------------------------------------------------------