The Arduino-mbed core comes with a precompiled version of mbed (sourced from here). Even if we would set the the appropriate flags (as documented for normal mbed-os, via build_flags = -D MBED_BUILD_PROFILE_DEBUG), it wouldn’t work, since the actual mbed-os sources aren’t recompiled. The original mbed-os settings can be found here.
It seems to me like that they’ve extended their base mbed-os version (which is mbed-os 6.2.0) with the necessary target files and use this script to create an mbed-os program, apply their patches and create the binaries. Specifically, their readme states how to build the mbed-os base libraries in debug mode.
I see 3 pathways here:
try and analyze the crash dump output that you’re currently getting without more debug info
if you post the crash output (there should be at least some output, even in release mode) along with some code, we might figure out why it crashes
if there are addresses where it crashes you can still use normal arm-none-eabi-addr2line tools together with the generated firmware.elf to pin down the location of the crash
use the README above to recreate the mbed-os libraries in debug mode, then use the results of that and overwrite the existing ones in the lib folder of the variant as I’ve linked above
might be feasable if the script works without problems
add full native framework = mbed support for the Nano 33 BLE with the modified mbed-os package that they’re using
might be a little bit more complicated with board manifest changes (and python logic changes?)
has the advantage of only building mbed-os and it becoming fully modifyable, instead of working with one precompiled version
I don’t have a cash dump output to analyze, this is what I would like to get my hands on, nothing is output when mbed crashes and the onboard LED goes into its crash sequence. Is there anything I can do to diagnose the lack of output?
I could re-compile the Arduino-mbed, I believe however their script is not compatible with macOS – and that’s what I’m running.
This would be the most ideal, I’ve tried running with framework = mbed but there’s clearly more work to be done to make that happen. I’m not experienced enough with the details of mbed/platformio/embedded build chains to know where to start on this path. Do you have an guidance on what would need to be done?
the crash happened in a global constructor or somewhere so low-level that it didn’t output anything
or the crash output is not being sent over the USB-Serial, but the STDIO UART. (This also makes sense since you want to output a crash output not through complicated USB protocols but as reliably and quickly as possible)
Do you have a USB-UART converter to hook up its RX to the TX of the Nano 33 BLE board, plus GND to GND? (You can also use an Arduino Uno or similiar as a USB-UART bridge).
Ah it’s a bash script and mac-OS should be able to handle it. I can also use a VM to attempt recompilation. But if the output per above doesn’t appear on the USB Serial anyways, it wouldn’t make a difference in that case.
This is likely the case, I’ll have to break out my soldering iron and find an old arduino to build that bridge.
The Arduino Nano 33 BLE has an operating voltage of 3.3v, and the other boards mentioned are all 5v, if I’m not mistaken, this will cause problems correct? Scatch that, I have a Arduino Zero which is 3.3v
I don’t really want to re-build the mbed os library if I don’t need to, would rather spend effort on path 3 as mentioned.
I’d be curious if there was a path to skip the Arduino-mbed library entirely and load mbed directly to the Nano 33 BLE. I may be completely mis-understanding the ecosystem though.
Actually looks pretty promising – using the script and some tweaks I was able to get an mbed-os 6.2.0 core, apply the patches and compile an application. With a small modified board JSON file to declare mbed-os framework compatibility and build information and packaging the mbed-os core in some repo, it should be pretty straight-forward to set up.
It’s also interesting that mbed-os since 6.2.0, all up to the the latest version 6.8.0 has the code for the TARGET_ARDUINO_NANO33BLE board, but maybe not all the patches – so I’ll stick with with the core that Arduino is using and their specific patches. Or both for fun.
So I’ll see to it that the board manifest file and the packages are expanded to support building for standard mbed-os, mbed-os with Arduino patches and Zephyr. All but the “mbed-os with Arduino patches” package already exist within the PlatformIO repos, so it should be straightforward.
Any SWD probes should work, like e.g. very cheap ST-Link V2 clone dongles, or the ST-Link section of a STM Nucleo board (then configured with upload_protocol = cmsis-dap in the platformio.ini). A JLink or Blackmagic probe works too.
Note that you would also need to solder the two SWDIO+SWCLK wires to the board which are exposed on the back to be able to connect it to the SWD probe, as shown e.g. here.