[STM32F407xx] - NRF24L01

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.
Post Reply
nebelgrau
Posts: 8
Joined: Mon Jun 03, 2019 4:37 pm

[STM32F407xx] - NRF24L01

Post by nebelgrau » Tue Oct 15, 2019 8:06 pm

I'm trying to use the NRF24L01 chip with the STM32F407xx black board. I was checking the test script here: https://github.com/micropython/micropyt ... l01test.py - if I run micropython.platform, the board comes up as "pyboard", but it's clearly not pin-compatible. Question: what are the pin names for the NRF24L01 socket on the board, and how to set this chip up? I tried following this: https://stm32f4-discovery.net/2014/06/l ... stm32f4xx/ for pinout, but it's about the discovery board which clearly doesn't have the NRF socket. Any ideas?

UPDATE: I tried using pins from this schematics: https://os.mbed.com/users/hudakz/code/S ... /shortlog/,
so:
cfg = {'spi':1, 'miso':'PB4', 'mosi':'PB5', 'sck':'PB3', 'csn':'PB7', 'ce':'PB6'}
and then
csn = Pin(cfg['csn'], mode=Pin.OUT, value=1)
ce = Pin(cfg['ce'], mode=Pin.OUT, value=0)
nrf = NRF24L01(SPI(cfg['spi'], csn, ce, payload_size=8)

but all I get is OSError: nRF24L01+ Hardware not responding

:?

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: [STM32F407xx] - NRF24L01

Post by mcauser » Wed Oct 16, 2019 6:35 am

It's coming up as 'pyboard' as that's the default for the STM32 port.

Pinout:
https://github.com/mcauser/BLACK_F407VE#nrf24l01-jp2

Code: Select all

+-------------------------------------+
|  USB          JTAG       MicroSD    |
|                                     |
|  2 4 6 8                            |
|  1 3 5 7                            |
|  NRF                                |
* 1 GND
* 2 3V3
* 3 PB6 NRF_CE
* 4 PB7 NRF_CS
* 5 PB3 SPI1_SCK
* 6 PB5 SPI1_MOSI
* 7 PB4 SPI1_MISO
* 8 PB8 NRF_IRQ

Orient the NRF24L01 so that the antenna is furthest away from the board.

The ZE and ZG boards have a different set of pins:
* 1 GND
* 2 3V3
* 3 PG6 NRF_CE
* 4 PG7 NRF_CS
* 5 PB3 SPI1_SCK
* 6 PB5 SPI1_MOSI
* 7 PB4 SPI1_MISO
* 8 PG8 NRF_IRQ
https://github.com/mcauser/BLACK_F407ZE#nrf24l01-j8
https://github.com/mcauser/BLACK_F407ZG#nrf24l01-j8

You can tell which board you have by looking where the USB and MicroSD are located.
The VE board has the USB on the left and the ZE/ZG has the USB on the right.

nebelgrau
Posts: 8
Joined: Mon Jun 03, 2019 4:37 pm

Re: [STM32F407xx] - NRF24L01

Post by nebelgrau » Wed Oct 16, 2019 7:55 am

Mine is definitely a VE board, and yes, got the antenna going outwards, as you said. So the pins seem to be declared correctly:
cfg = {'spi':1, 'miso':'PB4', 'mosi':'PB5', 'sck':'PB3', 'csn':'PB7', 'ce':'PB6'}, and I'm still getting that OSError. So what's wrong with my code? Is the IRQ pin supposed to be declared somewhere, too?

Post Reply