i am using the AMbiqSDK and apollo3 BSPs git from sparkfun (updated), and i copied the files from the folder …/boards/apollo3_evb/examples/ble_freertos_amdtps into the …/AMbiqSuiteSDK/boards_sfe/artemis_thing_plus_examples/ble_freertos_amdtps folder. I updated the Makefile file and, using the asb_linker script, the following error appears when executing make:
...
Compiling gcc startup_gcc.c
Linking gcc bin/ble_freertos_amdtps_asb.axf with script ../../../../common/tools_sfe/templates/asb_linker.ld
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: bin/ble_freertos_amdtps_asb.axf section `.stack' will not fit in region `sram'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: region `sram' overflowed by 11000 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:319: bin/ble_freertos_amdtps_asb.axf] Error 1
The lines from the Makefile related to the asb_linker are the following:
Hi @KHE, which linker script are you using, asb_linker.ld or ./ble_freertos_amdtps.ld ?. Could you please share the last lines when you make the ble_freertos_amdtps example using this Makefile? Thanks
As for linkers… In the working freertos example I chose to use the original linker script from the Apollo3 EVB. For the SVL the only modification required was to change the offset of FLASH memory to 0x10000 (from 0xC000)
Hi @liquid.soulder … in case i copy the original linker script from the ble_cordio_tag example folder for Apollo3 EVB , and i modified it according to your post, it get compiled, linked and uploaded successfully by using make bootload_svl. Great! … however, in case i use the asb_svl_linker.ld script from boards_sfe/common/tools_sfe/templates/asb_svl_linker.ld, it fails and the following error is reported:
Compiling gcc startup_gcc.c
Linking gcc ../gcc/bin/ble_cordio_tag_svl.axf with script ../../../../common/tools_sfe/templates/asb_svl_linker.ld
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: ../gcc/bin/ble_cordio_tag_svl.axf section `.stack' will not fit in region `sram'
c:/program files (x86)/gnu tools arm embedded/9 2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: region `sram' overflowed by 11000 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:444: ../gcc/bin/ble_cordio_tag_svl.axf] Error 1
Does it make sense to you? … can the asb_linker.ld / asb_svl_linker.ld files provided into the boards_sfe folder have some error?. Thanks for your help!
Makefile.txt (19 KB)I was successful (after 2 full days) of moving the amdtps example from the new SDK 2.3 to boards_sfe using liquid’s new makefile strategy. I basically modified the tag makefile a little to create the attached makefile. Here are the steps and the makefile will be attached with .txt on end (as I can’t figure out how to upload file with no extension):
AMSDK example to Spark Fun boards_sfe conversion
Copy ble_freertos_amdtps directory from SDK/boards/apollo3_evb/examples/ to SDK/boards_sfe/common/examples
SDK/boards_sfe/common/examples/ble_freertos_amdtps delete iar and keil directories
SDK/boards_sfe/common/examples/ble_freertos_tag/gcc copy ble_freertos_tag_asb.ld and ble_freertos_tag_svl.ld to the SDK/boards_sfe/common/examples/ble_freertos_amdtps /gcc directory.
Download attached Makefile (rename to remove .txt extension) and replace SDK/boards_sfe/common/examples/ble_freertos_amdtps /gcc/Makefile with this downloaded Makefile.
From git bash terminal cd to SDK/boards_sfe/common/examples/ble_freertos_amdtps/gcc
For example edge2 board: type EDGE=edge2
type make BOARD=$EDGE
will compile to final copy to bin with last line looking like:
make BOARD=EEDGE bootload_svl will load the board if on COM4 (change in Makefile)
if problem with bootload_svl, try bootload_asb. If ever successful with booload_svl, may need to reset board in Arduino with Tools / Burn Bootloader (Programmer: Ambiq Secure Bootloader)
Hi @KHE, just an small change. In step 3), it is requierd to rename the file ble_freertos_tag_asb.ld to ble_freertos_amtdps_asb.ld, and the file ble_freertos_tag_svl.ld to ble_freertos_amtdps_svl.ld . I’ve checked it, and following the steps you provide, i successfully made ble_freertos_amtpds example work in my artemis thing plus board. Thanks!
oops #3…good thing I’m not a banker…Thank you fbtobajas
so with corrections…
AMSDK example to Spark Fun boards_sfe conversion
Copy ble_freertos_amdtps directory from SDK/boards/apollo3_evb/examples/ to SDK/boards_sfe/common/examples
SDK/boards_sfe/common/examples/ble_freertos_amdtps delete iar and keil directories
SDK/boards_sfe/common/examples/ble_freertos_tag/gcc copy ble_freertos_tag_asb.ld and ble_freertos_tag_svl.ld to the SDK/boards_sfe/common/examples/ble_freertos_amdtps /gcc directory. Rename the file ble_freertos_tag_asb.ld to ble_freertos_amtdps_asb.ld, and the file ble_freertos_tag_svl.ld to ble_freertos_amtdps_svl.ld .
Download attached Makefile (rename to remove .txt extension) and replace SDK/boards_sfe/common/examples/ble_freertos_amdtps /gcc/Makefile with this downloaded Makefile.
From git bash terminal cd to SDK/boards_sfe/common/examples/ble_freertos_amdtps/gcc
For example edge2 board: type EDGE=edge2
type make BOARD=$EDGE
will compile to final copy to bin with last line looking like:
make BOARD=$EDGE bootload_svl will load the board if on COM4 (change in Makefile)
if problem with bootload_svl, try bootload_asb. If ever successful with booload_asb, may need to reset board in Arduino with Tools / Burn Bootloader (Programmer: Ambiq Secure Bootloader)
MAY HAVE TO RENAME BOARD DIRECTORY NAME TO REMOVE UNDERSCORES…
FYI … Link Problem with redboard_artemis_nano: compiled but wouldn’t link ‘till renamed boards_sfe/redboard_artemis_nano directory to boards/sfe/nano, then it worked fine.
Underscores causing the problem. I renamed board directory to 123456789012345678901 and it worked . 12345678_9012345_6789 had the same error.therefore underscore problem, not length.
Error when NANO=redboard_artemis_nano was used:
Linking gcc …/gcc/redboard_artemis_nano/bin/ble_freertos_amdtps_asb.axf with script …/…/…/…/common/examples/ble_freertos_amdtps/gcc/ble_freertos_amdtps_asb.ld
arm-none-eabi-gcc.exe: error: …/…/…/…/redboar: No such file or directory