Weird hangs RFM69 + WeAct Blackpill V2

All about boards manufactured by ST
Codeblocks
Posts: 7
Joined: Fri Apr 16, 2021 8:52 pm

Re: Weird hangs RFM69 + WeAct Blackpill V2

Post by Codeblocks »

Edit: After all my changes still nothing! :( The exact same issue. I think I will give libmaple a try next thanks. But I will definitely do some more in depth debugging to see exactly where it hangs. I tried every SPI clock speed from 1 to 8mhz.

Edit2: I did some debugging and found the exact line it hangs on in the function:

Code: Select all

void RH_RF69::setOpMode(uint8_t mode)
{
    uint8_t opmode = spiRead(RH_RF69_REG_01_OPMODE);
    opmode &= ~RH_RF69_OPMODE_MODE;
    opmode |= (mode & RH_RF69_OPMODE_MODE);
    spiWrite(RH_RF69_REG_01_OPMODE, opmode);

    // Wait for mode to change.
    while (!(spiRead(RH_RF69_REG_27_IRQFLAGS1) & RH_RF69_IRQFLAGS1_MODEREADY))
	;
}
It hangs waiting for the SPI mode to change, on the fixed board it seems to hang forever on the while loop. It is failing on a call to setModeTx. After fixing the wiring it hangs forever in this loop trying to switch to transmit mode.
Codeblocks
Posts: 7
Joined: Fri Apr 16, 2021 8:52 pm

Re: Weird hangs RFM69 + WeAct Blackpill V2

Post by Codeblocks »

The fact that it ever thought it was sending successfully was due to some wiring errors causing multiple devices to use pins that share a line, in reality it hangs permanently trying to switch to transmit mode and never successfully sends. Going to give libmaple a try tonight.
ag123
Posts: 730
Joined: Thu Dec 19, 2019 5:30 am
Answers: 3

Re: Weird hangs RFM69 + WeAct Blackpill V2

Post by ag123 »

for the official core there is one more thing you could try HAL
https://visualgdb.com/tutorials/arm/stm32/spi/
just that i've not tried this myself. stm32 HAL is actually c code rather than c++ codes.
Post Reply

Return to “STM boards (Discovery, Eval, Nucleo, ...)”