Avatar for urish

urish

Member since Jun 2018 • Last active Jan 2020
  • 4 conversations
  • 42 comments

Most recent activity

  • in ESP32
    Avatar for urish

    I'd also love to see faster hardware SPI in Espruino

  • in Porting to new Devices
    Avatar for urish

    Agreed - PR on its way, along with some other fixes that are required for making GPIO1 work

  • in Porting to new Devices
    Avatar for urish

    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](http://forum.espruino.com/search/?­q=%23if) defined (NRF52)
        [#ifndef](http://forum.espruino.com/sear­ch/?q=%23ifndef) NRF52832_XXAA
            [#define](http://forum.espruino.com/sear­ch/?q=%23define) NRF52832_XXAA
        [#endif](http://forum.espruino.com/searc­h/?q=%23endif)
    [#endif](http://forum.espruino.com/searc­h/?q=%23endif)
    

    This defines NRF52832_XXAA, and thus causing both nrf52832_peripherals.h and nrf52840_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?

  • in Porting to new Devices
    Avatar for urish

    I managed to narrow it down by looking at the generated assembly code - it seems like for some reason, GPIO_COUNT is set to 1, thus causing the wrong branch to be taken in nrf_gpio_pin_port_decode() in nrf_gpio.h.

  • in Porting to new Devices
    Avatar for urish

    So far, I learned that I can poke the GPIO register to make it work:

    1. Set it to output - poke32(0x50000300+0x518, 1 << 11)
    2. Write 0 - poke32(0x50000300+0x50c, 1 << 11)
    3. 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.

  • in Porting to new Devices
    Avatar for urish

    @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 digitalWriteing 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?

  • in Porting to new Devices
    Avatar for urish

    Update: seems like commenting out this line solves the advertising issue. Calling sd_ble_gap_adv_set_configure with 0 for the second parameter seems to remove all the advertising data.

  • in Porting to new Devices
    Avatar for urish

    Update: it works well on nRF52840DK, but I had to follow @the1laz steps first:

    cd targetlibs/nrf5x_15/
    wget https://developer.nordicsemi.com/nRF5_SD­K/nRF5_SDK_v15.x.x/nRF5_SDK_15.0.0_a5364­1a.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.

  • in Porting to new Devices
    Avatar for urish

    @Gordon I don't remember too much, but I will give it another go now and update shortly!

Actions