Open theelims opened 4 years ago
Hi @theelims ,
source files are not there since we precompile them (via mbed-os-to-arduino
script) and only provide the headers. So, you can freely use all the functions defined in the headers files and they will be resolved when linking against libmbed.a .
mBED provides a very specific version of the SDK with some custom patches applied so the files obtained from another SDK could not work as expected.
Anyway, at least to fix compilation, you must place the extra files in a folder that is scanned at compile time (your sketch itself is a good place in this case). Just add them to the sketch folder and you are done :wink:
Hi @facchinm , thank you for your help. I tried as you suggested and moved to the two files into the sketch folder. But the compiler message stayed the same.
But I think I found the root cause. The timer functions are never pre-compiled into libmbed.a in the first place. They need to be activated inside sdk_config.h where they are disabled by default.
So I would either need to make my own pre-compiled version of libmed.a with the required nrfx-drivers enabled or tell the compiler to build everything from scratch.
Could you please advise me how to do so? That's way over my head.
To produce a different libmbed.a the procedure is straightforward (from Linux and probably from Mac).
You wound need to download a local copy of https://github.com/ARMmbed/mbed-os , modify the sdk, navigate to the NANO 33 BLE core (in ~/.arduino15/packages/arduino/hardware/mbed/1.1.4/
) and run ./mbed-os-to-arduino -r $path_where_you_downloaded_mbed_os ARDUINO_NANO33BLE:ARDUINO_NANO33BLE
.
In this way, it will rerun our build script but using your modified sdk.
Can this be done on Windows as well? Cygwin maybe?
This way certainly works for one-off projects. But do you see a chance of somehow make the advanced sdk functions available natively from within the Arduino environment? Otherwise the whole NANO 33 BLE boards stay limited to what mbed is offering. Tight real-time applications or other advanced hardware peripherals won't be doable with this board.
I was planing on releasing shields or derived boards and open source them. But if everyone interested in playing with these boards would need to go through these steps this would be quite a steep barrier.
@theelims mbed usually strives enable all the drivers; if a driver is deactivated in the sdk, it probably mean that:
Did you try measuring mbed::Timer
's jitter? It should be based on the same timer AFAIK, and you can improve the precision with this code
Hi @theelims , check https://github.com/arduino/ArduinoCore-nRF528x-mbedos/pull/72, in which I used functions of the Nordic SDK 15 directly, in order to exploit hardware peripherals (timer included). The problem of your sketch is that it refers to functions of the nordic SDK11. Instead, the SDK15 ones should be used. Try to use "nrfx_timer.c" from SDK15, that is the analogue of "nrf_drv_timer.c" from SDK11. Also, when using timers, take in mind that TIMER1 is already employed by nrf libraries to implement the us_ticker for mbed os. You can find it here: https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/us_ticker.c Then, TIMER0 is used for nordic 'SoftDevice' that we are not exploiting, so if I'm not wrong it can be used for other purposes.
Hi @Polldo,
wow, you puzzled all the pieces together I need. Just the other way around. I will have a closer look at your code. Thanks. I'll revisit my project again.
The last days I tried to gain access to the Nordic SDK below the mbed layer. My application needs tight timings and the mbed timers caused to much jitter. Therefore I tried going with the hardware timer and nrf52's PPI module. I tried to get a modified timer-example from the nordic SDK to compile. So far without success. I reached a dead end and are looking for advice.
I copied all missing files (nrfx_timer.c & nrf_drv_timer.h) into their respective folder. I took them from the nordic SDK 15.0.
Here is the actual code I'm trying to compile. Via googling I got the hint, that it doesn't find the nrfx_timer.c. The include paths in the includes.txt are all set to these folders. How do I tell the linker where to look?
Arduino and mbed are perfect for most high level stuff. However, some things need to be done with dedicated hardware peripherals. I would highly appreciate if it would be possible to use the advanced hardware features of this fantastic chip out of the arduino environment. Like it is possible an all other platforms.