Open dagnolof opened 3 years ago
Getting a modern LMiC to fit in an ATmega328p is a bit challenging, it's not really a recommended target platform.
However, you have an additional issue in that your particular board has a larger than needed bootloader, leaving less space for the sketch code. Compare these lines of Arduino boards.txt:
pro.menu.cpu.8MHzatmega328.upload.maximum_size=30720
vs
uno.upload.maximum_size=32256
Which reveal that more optimal bootloaders for the ATmega328p like that used on the Uno would leave more space, possibly just barely enough to fit modern LMiC.
If you have an ISP setup (possibly another Arduino running the ISP sketch) it might be possible to change the bootloader and either start pretending your pro mini is some other board, or even create a custom boards.txt entry giving the altered bootloader and size. But that's not going to be simple.
And even once the program space fits, you also have to figure out how to use quite a bit less RAM, because regardless of bootloader, all ATmega328p's have only 2048 bytes of RAM.
Even if you get this working now, if you want to work with LoRaWan on an ongoing basis you should really change to an embedded board that's better supported, eg feather M0 or whatever else is currently on the recommended list.
Thanks, Chris (good to see you)!
@dagnolof, you should look at the configuration I use for CI testing. I think you need to change a few config settings to reduce the RAM usage. The most important one is to reduce the maximum message size to 64 bytes (or smaller); the LMIC has fixed buffers that are 2x that number of bytes, and the default is 240. So it saves a lot of RAM. Also turn off ClassB support.
Arduino Pro Mini Atmega328P 3.3V 8MZ Arduino IDE Version 1.8.15 MCCI LoRaWAN LMIC Library Version 4.0.0
I am trying to setup a lorawan device using Arduino Pro Mini and RFM95 module according to tutorial https://www.mobilefish.com/developer/lorawan/lorawan_quickguide_build_lora_node_rfm95_arduino_pro_mini_v3.html
However i can not compile the code.
I get following error `data section exceeds available space in boardSketch uses 25688 bytes (83%) of program storage space. Maximum is 30720 bytes.
Global variables use 2331 bytes (113%) of dynamic memory, leaving -283 bytes for local variables. Maximum is 2048 bytes. Not enough memory; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing your footprint. Error compiling for board Arduino Pro or Pro Mini. `
I am struggling with this issue for a while now.
Can you please give me an indication on how to proceed with this problem
This is the code i am using. It is base on ttn-otaa example
Thanks in advance, Fabrizio