Flashing NRF using pyOCD

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Flashing NRF using pyOCD

Post by devnull » Sun Jan 05, 2020 1:33 pm

I also tried adding the port enable code here, and did a fresh clone of the entire build and re-built again, but still nothing at all:

Code: Select all

    // Main script is finished, so now go into REPL mode.
    // The REPL mode can change, or it can request a soft reset.
    int ret_code = 0;

//PAC P0.10 LED On
nrf_gpio_cfg_output(10);
nrf_gpio_pin_set(10);

#if MICROPY_PY_BLE_NUS
    ble_uart_init0();
#endif

c45713
Posts: 51
Joined: Fri Dec 09, 2016 7:09 pm

Re: Flashing NRF using pyOCD

Post by c45713 » Sun Jan 05, 2020 5:02 pm

Could you try with a different pin than P0.10? From the datasheet this is "Digital I/O NFC input". Unless you have explicitly disabled NFC, i guess this will not show much output.

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Flashing NRF using pyOCD

Post by devnull » Sun Jan 05, 2020 11:00 pm

How careless of me, the holyroot pdf and diagrams just show this as a digital IO, just checked a schematic of the NRF8240 and you are correct, will try that.

But is my last mod to the main.c file correct ? - if you do this does a LED come on and stay on during bootup ?

I have set it to p0.22:

Code: Select all

// ## PAC P0.22 LED On ##
nrf_gpio_cfg_output(22);
nrf_gpio_pin_set(22);
Thanks

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: Flashing NRF using pyOCD

Post by devnull » Mon Jan 06, 2020 12:57 am

OK, success using pyocd, I will update my findings later.

Post Reply