Hi liquid.soulder! Thanks for the link!
It was somewhat helpful. I tried “porting” (translating?) the code you provided for use on the Edge board. I read the code, trying to identify the key parts that would get me going on the Edge.
I don’t know how well I did, because right now I’m stuck in linking the objects after compiling. I stitched the code all I thought was necessary, and at the last step, which is compiling and shipping to the board, I ran into “undefined reference” issues.
It’s mostly with key function calls somewhere within NusStart() [1], which is the function that starts the profile for the example:
...
...
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: bin/nus_api.o: in function `tagBtnCback':
/opt/AmbiqSuite-Rel2.2.0/boards/apollo3_evb/examples/area_privada_projeto/gcc/../src/nus_api.c:701: undefined reference to `FmplSendAlert'
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/AmbiqSuite-Rel2.2.0/boards/apollo3_evb/examples/area_privada_projeto/gcc/../src/nus_api.c:706: undefined reference to `FmplSendAlert'
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: bin/nus_api.o: in function `tagDiscCback':
/opt/AmbiqSuite-Rel2.2.0/boards/apollo3_evb/examples/area_privada_projeto/gcc/../src/nus_api.c:861: undefined reference to `FmplIasDiscover'
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/AmbiqSuite-Rel2.2.0/boards/apollo3_evb/examples/area_privada_projeto/gcc/../src/nus_api.c:884: undefined reference to `GattDiscover'
/opt/gcc-arm-none-eabi-8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: /opt/AmbiqSuite-Rel2.2.0/boards/apollo3_evb/examples/area_privada_projeto/gcc/../src/nus_api.c:889: undefined reference to `GapDiscover'
...
...
Note: the AmbiqSuite path is because I tried stitching the code you provided into one of the bluetooth examples from AmbiqSuite SDK, as a last resort. This way I could just use the pre-made Makefile and add whatever was missing as needed. Didn’t have any luck in the linking phase though.
Could this be some compiler flag that I’m missing? I don’t know what to try next.
Could you please help me? Or connect me with someone who can?
I was hoping to get through the basic functionalities (buttons, LEDs, bluetooth, etc) of the board before downloading my models to it.
Once I’ve succeeded, and since it’s been so hard, I’ll write some tutorials to help get through all this much easier.
If you can help me, let me know how I can give you more details of what I’m doing.
[1]: https://github.com/sparkfun/Arduino_Apo … in.c#L1158