sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.6k stars 621 forks source link

Сompatibility with STM32F401 and optimization #695

Open AlexandrJet opened 4 days ago

AlexandrJet commented 4 days ago

Hi. I tested my Ai-thinker RA-02 (sx1278) on Arduino Nano and STM32F401 ( with STM32duino, no optimization). After testing i got interesting situation: the same code, based on dump register example, got a different results:

Fragment of results on STM32: 0x3C: 0x3C 0x3D: 0x3D 0x3E: 0x3E 0x3F: 0x3F 0x40: 0x40 0x41: 0x41 0x42: 0x42 0x43: 0xC3 0x44: 0xC4 0x45: 0x45 0x46: 0x8E 0x47: 0x47

Fragment of results on Nano: 0x3C: 0x0 0x3D: 0xAF 0x3E: 0x0 0x3F: 0x0 0x40: 0x0 0x41: 0x0 0x42: 0x12 0x43: 0x24 0x44: 0x2D 0x45: 0x0 0x46: 0x3 0x47: 0x0 Look at 0x42 register. The value of 0x42 must be 0x12, but on STM32 we got another. Why is this happening? - I don`t know...

I`m not sure that is a LoRa library problem, but i think i must informed you. I will make the same issue on STM32duino page.

Also, what do you think to make readRegister() and writeRegister() like as macros?

P.S. - Sorry for my English