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.
for the first issue:
_Static_assert (LastPort <= 0x0F, "PortName must be less than 16");
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!
[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…
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
I’ll let you know in case it works with the RFM69 module (hope to get some spare time during the weekend).
As IRQ pin I tried both PA3 and PA10.
uint8_t _interruptPin;
uint8_t _interruptNum;
I think one is used for defining the STM32 PIN and the other for the equivalent PIN on Arduino.
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
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
attachInterrupt() needs as first parameter the interrupt pin
Please specify the pin in PXY format (ex. PA3, PB8, etc.)
#define RF69_IRQ_PIN 0
#define RF69_IRQ_NUM PA3 ?
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');
}
#define IRQPIN PA3
RFM69STM32 radio(CSPIN, IRQPIN, true, 3);
[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?
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)
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)
[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.
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);