Hi,
I am attempting to import an existing IAR project to SES / GCC and am having some trouble. I recently joined the project team and we are making an effort to switch from the paid IAR license that our contracting firmware group has used to a free IDE/toolchain in order to take over development.
It began as a ble_app_hrs example and dfu secure_bootloader example was later incorporated, but it has come a long way.
I am not yet familiar with IAR so I am having some trouble translating the IAR .icf linker files, macros, and preprocessor definitions to work with the Segger internal GCC toolchain. I have been looking for any guides or assistance that I can find, but there doesn't seem to be much on the subject.
I followed the Segger guide for porting projects from IAR (link) but it is not specific to Nordic or comprehensive, and I have had difficulty at the troubleshooting memory linker script section. I also referenced the Nordic guide for Importing from Keil but it seems a bit out of date. After creating a flash_placement.xml file based off the original SES examples' flash_placement.xml files, and then changing the FLASH and RAM section placement macros and Heap/Stack size in runtime memory area settings I am still unable to compile and am seeing the following errors:
Building ‘neop_hat_main_s132_with_dfu_pca10040’ from solution ‘project’ in configuration ‘nrf52832_xxaa_s132 Internal’
...
Output/nrf52832_xxaa_s132 Internal/Exe/neop_hat_main_s132_with_dfu_pca10040.elf does not exist.
Generating linker script ‘neop_hat_main_s132_with_dfu_pca10040.ld’
Linking neop_hat_main_s132_with_dfu_pca10040.elf
Output/nrf52832_xxaa_s132 Internal/Exe/neop_hat_main_s132_with_dfu_pca10040.elf section `.init' will not fit in region `UNPLACED_SECTIONS'
region `UNPLACED_SECTIONS' overflowed by 16688 bytes
cannot find entry symbol reset_handler; not setting start address
Output/neop_hat_main_s132_with_dfu_pca10040 nrf52832_xxaa_s132 Internal/Obj/ses_startup_nrf52.o: in function `_vectors':
(.vectors+0x0): undefined reference to `__stack_end__'
(.vectors+0x4): undefined reference to `Reset_Handler'
Output/neop_hat_main_s132_with_dfu_pca10040 nrf52832_xxaa_s132 Internal/Obj/nrf_sdh.o:(.rodata.sdh_stack_observers+0x0): undefined reference to `__start_sdh_stack_observers'
Output/neop_hat_main_s132_with_dfu_pca10040 nrf52832_xxaa_s132 Internal/Obj/nrf_sdh.o:(.rodata.sdh_stack_observers+0x4): undefined reference to `__stop_sdh_stack_observers'
Post-build command
\GIT\Neopenda\Firmware\neop_hat_main\pca10040\s132_with_dfu\iar>echo Creating folder for DFU packages if not exist... 1>.\..\..\..\tools\"\postBuildLog.txt
\GIT\Neopenda\Firmware\neop_hat_main\pca10040\s132_with_dfu\iar>if not exist ".\..\..\..\tools\"\DFU_Packages" mkdir .\..\..\..\tools\"\DFU_Packages
Build failed
So my questions are:
- Is there anything obvious I am doing wrong based on error output?
- Which startup files should I be including? I added thumb_crt0.s as the Keil importing guide instructed - is this correct? Should I also add ses_startup_nrf_common.s (it is in the ble_app_hrs example but causes more errors when I include it). Anything else?
- Is there any more comprehensive guide or any other useful information available on converting the IAR linker scripts correctly to corresponding GCC linker scripts and allocating memory correctly in the flash_placement.xml format?
- Am I going about this the right way or is there anything else I should be considering or referencing at this point in order to successfully migrate the project?
I am aware that importing existing IAR projects can be challenging. If there is anything else that can help us do so I would like to pursue it. If however, the recommendation is that this is a mess and to stay with IAR at all costs we would consider that as well.
Thanks!