I checked out the branch feature/ble/peripheral and I’d like to be able to build an app against it. I do a:
make all PLATFORM=argon APPDIR=…/…/my-app
In the device-os/modules directory (like normal), however I get linking errors related to ble:
main.cpp:182: undefined reference to `hal_ble_init'
undefined reference to `ble_set_device_name'
undefined reference to `ble_set_scanning_params'
undefined reference to `ble_register_callback'
undefined reference to `ble_start_scanning'
What are the modifications (possibly to the makefile) that I would need to be able to link against these libraries? I took a look and it looks like those symbols are in libhal.a – however the default build script links against libhal-dynamic.
I’d love to be able to use the features in this branch, but it looks like the normal path for apps hasn’t been updated yet?
I believe the problem is that the BLE HAL has been completed in the branch, but there are two parts to the feature. Other other is the Wiring API, which exposes the HAL functions to the user application firmware.
Until the second part is done, you can only use monolithic firmware (build from firmware/main with MODULAR=n), which eliminates the separation between user and system firmware and allows user firmware to make direct calls into the system.
I was able to switch back to the previous firmware and flash it back.
Question: When flashing to the non-modular build the first time, is it necessary to do it from the modules directory (so as to write the app and OS at the same time?)
When you build MODULAR=n from main, the system is included in your binary so you don’t need to build from modules.
When you go back to modular, flash system-part-1 then your modular binary or tinker by USB. You need both going in the monolithic to modular direction.
Super helpful, thanks! I’ve got it all sorted now… WITH ble features working now. I’m piecing together what I need to do by reading through the ble headers, but if there is any official (or draft) documentation I’d be happy to take a look!