LanguidSmartass / mdb-arduino-cashless

MDB Cashless Device implementation based on Arduino Uno and GPRS Shield
74 stars 44 forks source link

Cannot compile #14

Closed AwesomeSorensen closed 5 years ago

AwesomeSorensen commented 6 years ago

Hey, i am really excited about your project here, but i simply cant get it to compile. I am trying to compile it in Arduino IDE, but it simply wont work. image

LanguidSmartass commented 6 years ago

Hello) You can't use 'Serial' class since it is mapped on the hardware USART0 module. This module is used in my MDB implementation, so you won't be able to use 'Serial.println' in your code. That's why the linker curses about multiple definitions of interrupt vectors 18 and 19, they are redefined in USART_ISR.c (and originally they are defined deep inside the Arduino libraries, if you use Arduino toolchain). You can go around that with a 'SoftwareSerial' class, USB-UART dongle and 3 jumper wires.

On Wed, Sep 5, 2018 at 12:23 PM Mads Damsgaard-Sørensen < notifications@github.com> wrote:

Hey, i am really excited about your project here, but i simply cant get it to compile. I am trying to compile it in Arduino IDE, but it simply wont work. [image: image] https://user-images.githubusercontent.com/30825079/45084182-f3e6be00-b0fd-11e8-91b2-702321d72aa8.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/LanguidSmartass/mdb-arduino-cashless/issues/14, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtRCq4oW51Cy040YcuOHY2nLdlqngQ-ks5uX5gagaJpZM4Wag6y .

AwesomeSorensen commented 6 years ago

But i have used your code without making any changes. If i cant make it work in Arduino IDE, can you please tell me how i then get it compiled instead?

LanguidSmartass commented 6 years ago

Well, to compile it under regular AVR-GCC you have to tear out some guts of the code from .ino files, rewrite them however you think is appropriate and run. There is also an irrelevant code to the task regarding GPRS modem SIM900 and an RFID card reader MFRC522 -- they do not have anything common with an MDB protocol. Which arduino do you use exactly? The code I've written was tested on UNO (ATmega328P).

On Wed, Sep 5, 2018 at 4:56 PM Mads Damsgaard-Sørensen < notifications@github.com> wrote:

But i have used your code without making any changes. If i cant make it work in Arduino IDE, can you please tell me how i then get it compiled instead?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LanguidSmartass/mdb-arduino-cashless/issues/14#issuecomment-418739649, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtRCod043ykZDv1_OgjsJCtSfLQ24MOks5uX9gNgaJpZM4Wag6y .

AwesomeSorensen commented 6 years ago

I have an Arduino UNO bought specifically for testing your project. I have tried making a version where i remove everything to do with the http server (i dont need that). But i still cant compile it. I am at the point where i get the above error for the vector 18 and 19, but i have not added anything new to your code, just removed some stuff. I tried with the MDB_SlaveAutonomous.ino file.

LanguidSmartass commented 6 years ago

According to the section 16.1 "Interrupt Vectors in ATmega328/P" on page 84 (link to the datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega328_P%20AVR%20MCU%20with%20picoPower%20Technology%20Data%20Sheet%2040001984A.pdf ) the linker is confused about these ISR vectors: 18 is the SPI Serial Transfer Complete 19 is the USART Rx Complete

Try to initialize and use USART.h/USART.c/USART_ISR.c separately to ensure that the 9-bit input-output works (just short the Tx-Rx pins together in a loopback mode). Exclude the SPI-related code (MFRC522 communicates through SPI). For communicating with an MDB Master you need only USART, ringBuf and MDB libraries, if I remember correctly. Anything else is just an example application state-machine code.

On Thu, Sep 6, 2018 at 12:04 PM Mads Damsgaard-Sørensen < notifications@github.com> wrote:

I have an Arduino UNO bought specifically for testing your project. I have tried making a version where i remove everything to do with the http server (i dont need that). But i still cant compile it. I am at the point where i get the above error for the vector 18 and 19, but i have not added anything new to your code, just removed some stuff. I tried with the MDB_SlaveAutonomous.ino file.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LanguidSmartass/mdb-arduino-cashless/issues/14#issuecomment-419020709, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtRCqMVWfrp-BFx48ItievT1So8JLelks5uYOUggaJpZM4Wag6y .

LanguidSmartass commented 6 years ago

In addition-- an important remark. You won't be able easily program and debug your UNO via USB-UART bootloader while using the USART library. I would advise to use an SPI programmer, it'll save you some nerves.

On Thu, Sep 6, 2018 at 12:17 PM TRiToNa-Ma jedi.orden@gmail.com wrote:

According to the section 16.1 "Interrupt Vectors in ATmega328/P" on page 84 (link to the datasheet http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega328_P%20AVR%20MCU%20with%20picoPower%20Technology%20Data%20Sheet%2040001984A.pdf ) the linker is confused about these ISR vectors: 18 is the SPI Serial Transfer Complete 19 is the USART Rx Complete

Try to initialize and use USART.h/USART.c/USART_ISR.c separately to ensure that the 9-bit input-output works (just short the Tx-Rx pins together in a loopback mode). Exclude the SPI-related code (MFRC522 communicates through SPI). For communicating with an MDB Master you need only USART, ringBuf and MDB libraries, if I remember correctly. Anything else is just an example application state-machine code.

On Thu, Sep 6, 2018 at 12:04 PM Mads Damsgaard-Sørensen < notifications@github.com> wrote:

I have an Arduino UNO bought specifically for testing your project. I have tried making a version where i remove everything to do with the http server (i dont need that). But i still cant compile it. I am at the point where i get the above error for the vector 18 and 19, but i have not added anything new to your code, just removed some stuff. I tried with the MDB_SlaveAutonomous.ino file.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/LanguidSmartass/mdb-arduino-cashless/issues/14#issuecomment-419020709, or mute the thread https://github.com/notifications/unsubscribe-auth/AQtRCqMVWfrp-BFx48ItievT1So8JLelks5uYOUggaJpZM4Wag6y .