I was an Arduino user for many years but thanks to the Xiao nrf52840 board from Seeed I completely fell in love with Nordic products. This is the reason why I tapped into new water and for the first time ever designed a custom board using the nrf52840 chip. I encountered a road block and maybe someone could point me to the right direction.
Custom board: The custom board is basically just a breakout board for most of the pins (plus a hall sensor and rfm95w lora chip). I copied the "Circuit configuration no. 6 for QIAA aQFN73".
My code: I use the nrf Connect SDK 2.4.0 and created a new board (using vscode plugin) based on the 52840 chip. My main.c just toggles a pin 26 (P0.26 // G1) HIGH every 2 seconds. No errors appear when I click on 'Build'.
Flashing the software: I have a J-link probe and are using the JFlash tool to
- connect to the board using SWD (Found 1 JTAG device. Core ID: 0x2BA01477 (None) - Connected successfully)
- Drag and drop the zephyr.hex file into JFlash and hit "Production programming"
Output:
Opening data file [/Users/basti/nrf_projects/hello_world/build/zephyr/zephyr.hex] ...
- Data file opened successfully (33292 bytes, 1 range, CRC of data = 0x215175CE, CRC of file = 0x1ADB6364)
Auto programming target (33292 bytes, 1 range) ...
- Checking if selected data fits into selected flash sectors.
- Start of preparing flash programming
- End of preparing flash programming
- Start of determining dirty areas in flash cache
- End of determining dirty areas
- CPU speed could not be measured.
- Start of erasing sectors
- Blank checking 0x00000000 - 0x00008FFF
- Erasing range 0x00000000 - 0x00008FFF ( 9 Sectors, 36 KB)
- End of erasing sectors
- Start of flash programming
- Programming range 0x00000000 - 0x00007FFF ( 8 Sectors, 32 KB)
- Programming range 0x00008000 - 0x00008FFF ( 1 Sector, 4 KB)
- End of flash programming
- Flash programming performed for 1 range (36864 bytes)
- 0x0000 - 0x8FFF ( 9 Sectors, 36 KB)
- Start of verifying flash
- End of verifying flash
- Start of restoring
- End of restoring
- Executing exit sequence ...
- De-initialized successfully
- Target erased, programmed and verified successfully - Completed after 1.166 sec
Starting application ...
So far so good. But here comes the problem.
Problem: Nothing happens on pin 26. I tried to measure some voltage changes, but nothing happens. As I am a beginner I am pretty sure that the error is me. Can someone point me in the right direction?
Here the code:
#include <zephyr/kernel.h> #include <hal/nrf_gpio.h> #include <nrfx_systick.h> #define g1 26 void main(void) { nrf_gpio_cfg_output(g1); while (true) { nrf_gpio_pin_set(g1); nrfx_systick_delay_ms(2000); nrf_gpio_pin_clear(g1); nrfx_systick_delay_ms(2000); } }