STM32-RFM69

kylix
Sun Dec 03, 2017 7:55 pm
Hello!

I’m trying to use an RFM69HW module with the STM32F401RE board (the project is this: https://github.com/brainelectronics/RFM69-STM32). I’ve just updated the STM32 cores to the latest available version: 24.11.2017 (Arduino IDE v1.6.9) but I get this error while compiling:

Arduino: 1.6.9 (Windows 7), Board: "Nucleo-64, Nucleo F401RE, Mass Storage, Generic Serial, None, Smallest (-Os default)"

Build options changed, rebuilding all
In file included from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\cores\arduino/stm32/PinNames.h:25:0,

from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\cores\arduino/stm32/pinmap.h:22,

from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\cores\arduino/stm32/PeripheralPins.h:34,

from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\cores\arduino/pins_arduino.h:21,

from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\variants\NUCLEO_F401RE\variant.h:26,

from C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\variants\NUCLEO_F401RE\variant.cpp:19:

C:\Users\Kylix\AppData\Local\Arduino15\packages\STM32\hardware\stm32\2017.11.24\cores\arduino/stm32/PortNames.h:74:17: error: expected constructor, destructor, or type conversion before '(' token

_Static_assert (LastPort <= 0x0F, "PortName must be less than 16");

^

exit status 1
Error compiling for board Nucleo-64.


fpiSTM
Mon Dec 04, 2017 5:56 am
Hi,

for the first issue:
_Static_assert (LastPort <= 0x0F, "PortName must be less than 16");


kylix
Mon Dec 04, 2017 10:14 am
I’m using Arduino IDE 1.6.9 on Windows, with STM32 Core installed through the Board Manager. What else should I do in order to have the right gcc version?

It’s strange that nobody has tried those libraries on F401RE yet …
In July I was able to compile it without errors for an STM32L053R8 board (I was using a different version of the STM32 Core package) but there was no signal getting out of the RFM69HW module (checked with SDRSharp software and USB dongle). I suppose the problem could be related to libmaple compatibility you were talking about…

In the second library, the pins are not hardcoded: https://github.com/goran-mahovlic/RFM69-STM32

Thanks for your time!


fpiSTM
Mon Dec 04, 2017 8:18 pm
[kylix – Mon Dec 04, 2017 10:14 am] –
It’s strange that nobody has tried those libraries on F401RE yet …

Maybe some have tested and fix issue themselves in the code library… :roll:

For this one, https://github.com/goran-mahovlic/RFM69-STM32
I’ve just tested and it still some SPI_def which has not been renamed.
I’ve only added #define SPI_def SPI


kylix
Mon Dec 04, 2017 10:08 pm
Thanks! It now compiles after adding “#define SPI_def SPI” and deleting the other version of gcc.
I’ll let you know in case it works with the RFM69 module (hope to get some spare time during the weekend).

kylix
Fri Dec 08, 2017 3:31 pm
The SPI seems to work as I can read RFM69’s registry and temperature. Unfortunately, it doesn’t transmit anything at all…
As IRQ pin I tried both PA3 and PA10.

stevestrong
Fri Dec 08, 2017 8:27 pm
I think there is a bug in line 150: it should be _interruptPin instead of _interruptNum.

kylix
Fri Dec 08, 2017 9:12 pm
They are both used:

uint8_t _interruptPin;
uint8_t _interruptNum;


stevestrong
Fri Dec 08, 2017 9:18 pm
attachInterrupt() needs as first parameter the interrupt pin, not the interrupt number (whatever it supposed to mean).

kylix
Fri Dec 08, 2017 9:22 pm
Line 49: https://github.com/goran-mahovlic/RFM69 … M69STM32.h

I think one is used for defining the STM32 PIN and the other for the equivalent PIN on Arduino.


stevestrong
Fri Dec 08, 2017 9:30 pm
I saw that.
My previous comment still applies. Sorry if you don’t want to try it. Good luck.

Btw, I used to use this lib: https://github.com/LowPowerLab/RFM69

Btw 2, it seems that you are double posting: viewtopic.php?f=15&t=1582&hilit=rfm69&start=10#p31497


kylix
Fri Dec 08, 2017 9:36 pm
Hi Steve,

you got me wrong! I appreciate all the suggestions you give.
It’s just I’ve already tried to assign the same value, something like:
#define RF69_IRQ_PIN 3
#define RF69_IRQ_NUM 3


stevestrong
Fri Dec 08, 2017 9:40 pm
Again:
attachInterrupt() needs as first parameter the interrupt pin

Please specify the pin in PXY format (ex. PA3, PB8, etc.)


kylix
Fri Dec 08, 2017 9:42 pm
Do you think this would work (instead of changing the .cpp file):

#define RF69_IRQ_PIN 0
#define RF69_IRQ_NUM PA3 ?


stevestrong
Fri Dec 08, 2017 9:44 pm
Replace in line 150
attachInterrupt(_interruptNum, RFM69STM32::isr0, RISING);

kylix
Fri Dec 08, 2017 9:45 pm
Testing right now!

PS: compiled but it’s not working. In addition, I cannot read anymore the temperature with:

if (input == 't')
{
byte temperature = radio.readTemperature(-1); // -1 = user cal factor, adjust for correct ambient
byte fTemp = 1.8 * temperature + 32; // 9/5=1.8
Serial.print( "Radio Temp is ");
Serial.print(temperature);
Serial.print("C, ");
Serial.print(fTemp); //converting to F loses some resolution, obvious when C is on edge between 2 values (ie 26C=78F, 27C=80F)
Serial.println('F');
}


kylix
Wed Dec 13, 2017 7:16 pm
I’ve tried again with:

#define IRQPIN PA3

RFM69STM32 radio(CSPIN, IRQPIN, true, 3);


stevestrong
Wed Dec 13, 2017 7:34 pm
[kylix – Fri Dec 08, 2017 9:36 pm] –
The library you pointed to, I’m using it with Moteino and RFM69HW and it works flawlessly.

I think you should use the same library which is working.
Please also post a simple test sketch to reproduce the problem.

Btw, which core do you use? The Arduino_STM32 or the STM32DUINO core?


kylix
Wed Dec 13, 2017 7:36 pm
Hi Steve,

I’m using the original library with Moteino (an Arduino clone).

The sketch I’m using with STM32F401RE is this: https://github.com/brainelectronics/RFM … -STM32.ino

I only tried to connect the IRQ to PA3 or PA10 for testing (obviously, changing the settings accordingly)


stevestrong
Wed Dec 13, 2017 7:38 pm
Which original library?

kylix
Wed Dec 13, 2017 7:43 pm
At the moment I’m trying to make this library work with STM32F401RE board: https://github.com/brainelectronics/RFM69-STM32

The original Lowpower Lab’s library I’m only using with an Arduino compatible board and it works only on Arduino as it is (https://github.com/LowPowerLab/RFM69)


stevestrong
Wed Dec 13, 2017 9:02 pm
Asking again: which core do you use? Arduino_STM32 or the STM32DUINO?

fpiSTM
Wed Dec 13, 2017 9:09 pm
[kylix – Sun Dec 03, 2017 7:55 pm] –
I’ve just updated the STM32 cores to the latest available version: 24.11.2017 (Arduino IDE v1.6.9) but I get this error while compiling:

I assume you use the STM core and you use the Nucleo F401. PA3 is used for Serial RX (via STLINK) so avoid to use it for attach interrupt.

By default your example (ino) set irqnum to 3. Even if it is a wrong name as it should be irqpin for attachinterrupt (as Steve already said several time).
https://github.com/brainelectronics/RFM … 32.ino#L63

So attach interrupt is done on D3. For Nucleo F401, it is the PB3, //D3
So IRQ_PIN in the sketch should be set to PB3 instead of PA3.
https://github.com/brainelectronics/RFM … 32.ino#L29

I think you have a misalignment with the pin.


kylix
Wed Dec 13, 2017 9:53 pm
Yes, I’ve just checked and I confirm that in “Boards manager” (Arduino IDE) I have “STM32 Cores by ST-Microelectronics” installed.

I’ll try to connect the IRQ PIN to PB3

THANKS!

PS: changed as it follows

#define IRQPIN PB3
RFM69STM32 radio(CSPIN, IRQPIN, true, 3); (true is needed for RFM69HW module)
attachInterrupt(_interruptPin, RFM69STM32::isr0, RISING);


kylix
Sat Dec 23, 2017 11:26 am
Other suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *