Most recent activity
-
-
-
I found the culprit -
targetlibs/nrf5x_15/modules/nrfx/mdk/nrf.h
contains the following:/* Redefine "old" too-generic name NRF52 to NRF52832_XXAA to keep backwards compatibility. */ [#if](https://forum.espruino.com/search/?q=%23if) defined (NRF52) [#ifndef](https://forum.espruino.com/search/?q=%23ifndef) NRF52832_XXAA [#define](https://forum.espruino.com/search/?q=%23define) NRF52832_XXAA [#endif](https://forum.espruino.com/search/?q=%23endif) [#endif](https://forum.espruino.com/search/?q=%23endif)
This defines
NRF52832_XXAA
, and thus causing bothnrf52832_peripherals.h
andnrf52840_peripherals.h
to be included, and then the fun begins...After commenting this out, I am finally able to use the GPIO1 pins. @gordon do you want me to add a new SDK patch and send a PR?
-
-
So far, I learned that I can poke the GPIO register to make it work:
- Set it to output -
poke32(0x50000300+0x518, 1 << 11)
- Write 0 -
poke32(0x50000300+0x50c, 1 << 11)
- Write 1 -
poke32(0x50000300+0x508, 1 << 11)
This works and blinks the LED. Thanks for the pointer - my test program (without Espruino) is able to write to this port using
nrf_gpio_pin_write
successfully (through with SDK 15.2). I will try to narrow it down and see why it doesn't work from within Espruino. - Set it to output -
-
@Gordon would you like me to look into that and send a PR?
On a different note, it seems like I am not being able to use any pins on the GPIO1 port. I have updated the board definition file to define ports up to D48, yet when
digitalWrite
ing to D43 I have no indication from a connected LED. I have checked with another firmware, and the LED is driven by this pin correctly. Any ideas where to look for the culprit? -
Update: seems like commenting out this line solves the advertising issue. Calling
sd_ble_gap_adv_set_configure
with0
for the second parameter seems to remove all the advertising data. -
Update: it works well on nRF52840DK, but I had to follow @the1laz steps first:
cd targetlibs/nrf5x_15/ wget https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.0.0_a53641a.zip unzip nRF5_SDK_15.0.0_a53641a.zip mv nRF5_SDK_15.0.0_a53641a/* . rm -rf nRF5_SDK_15.0.0_a53641a nRF5_SDK_15.0.0_a53641a.zip git apply patches/* rm -rf external/micro-ecc cp -Rp ../nrf5x_12/external/micro-ecc external/micro-ecc sed -i '/#include <nrfx\.h>/a # define NRFX_UARTE_ENABLED 0' integration/nrfx/legacy/nrf_drv_uart.h
and then compile:
make -DBOARD=NRF52840DK
The firmware seems functional, with one caveat - it won't advertise the board name nor the UART service, making it unconnectable from Espruino Web IDE. After patching the Web IDE to use the
acceptAllDevices
options I was able to connect to it from the IDE as well. -
@Gordon I don't remember too much, but I will give it another go now and update shortly!
-
- 14 comments
- 6,013 views
https://urish.org