Closed aksD3V closed 5 years ago
See this function in a reference file, the 9th bit is set there: void USART_Init(uint16_t baud_rate) https://github.com/LanguidSmartass/mdb-arduino-cashless/blob/master/USART.c
As for the files you're talking about -- they're seem to be from a different driver for some wifi shield. USART.c and USART.h that are used in my MDB implementation are located in the repository.
Hi Languid I get about 50 errors as follows. what is the problem? what should I do? please help. Arduino IDE version 1.8.9. I tried the arduino uno and mega but it didn't work. Thank you from now
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `vmc_config'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `vmc_prices'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `csh_error_code'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `csh_state'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `csh_poll_state'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `csh_config'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `vend_amount'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `user_funds'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `item_cost'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_Init'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_Send'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_Read'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_Peek'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_DataCount'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `JustReset'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `SessionCancelRequest'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `VendCashSale'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `MDB_CommandHandler'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_GetPollState'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_GetDeviceState'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_GetUserFunds'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_GetItemCost'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_GetVendAmount'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_SetPollState'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_SetDeviceState'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_SetUserFunds'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_SetItemCost'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\MDB.c.o (symbol from plugin): In function `vmc_config':
(.text+0x0): multiple definition of `CSH_SetVendAmount'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\MDB.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_Init'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_RXBuf_Read'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_RXBuf_Peek'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_TXBuf_IsEmpty'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_RXBuf_Count'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_Transmit'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_Receive'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_UDRI_Enable'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_TXBuf_Write'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART.c.o (symbol from plugin): In function `USART_Init':
(.text+0x0): multiple definition of `USART_UDRI_Disable'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART_ISR.c.o (symbol from plugin): In function `__vector_18':
(.text+0x0): multiple definition of `__vector_18'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\USART_ISR.c.o (symbol from plugin): In function `__vector_18':
(.text+0x0): multiple definition of `__vector_19'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufInit'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufFlush'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufPushFront'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufPopBack'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufPeekBack'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufIsEmpty'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufIsFull'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\ringBuf.c.o (symbol from plugin): In function `rBufInit':
(.text+0x0): multiple definition of `rBufElemCount'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\ringBuf.c.o (symbol from plugin):(.text+0x0): first defined here
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_18'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_19'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\sketch\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Those a linker errors.
Somehow you've got into situation where you're trying to link together same object files (.c.o files in this case), thus the "multiple definition of _somesymbol" pops up.
I'm not much into Arduino IDE, but I would suggest you to clean up any temporaries you can find related to this build.
Actually, on the second view of your log I can probably see why this is happening:
Let's take "ringBuf.c.o" for example -- that's an object file compiled from "ringBuf.c" source file.
You have two versions of it, one is at "C:\Users\EYP~ 1\AppData\Local\Temp\arduino_build_21082\sketch\" and the second is at "C:\Users\EYP~ 1\AppData\Local\Temp\arduino_build_21082\libraries\mdb-arduino-cashless-master\"
Since they're essentialy the same files, when linker tries to put them together into a final binary it throws the errors I described above, because both of them contain the definitions of the identical symbols (namely, functions and variables).
Maybe try to back up and then delete C:\Users\EYP~1\AppData\Local\Temp\arduino_build_21082\ directory and start anew.
First of all thank you for answering I did but I get the same errors. what else can I do
Just a general advice, since I can't tell you anything more specific:
Try to figure out which files linker tries to put together and why there a multiple compilation units of the same source files in the first place.
thank you i will try again and give information
I cleared temp files and libraries now gives these errors. Do you have any idea about this? //////////////////////////////////////////////////////////////////////////////////////////////// HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_18'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_763332\libraries\MDB\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
HardwareSerial0.cpp.o (symbol from plugin): In function `Serial':
(.text+0x0): multiple definition of `__vector_19'
C:\Users\EYP~1\AppData\Local\Temp\arduino_build_763332\libraries\MDB\USART_ISR.c.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Ok, those ones are actually related to this project.
Arduino's toolchain uses __vector_18 and __vector_19 symbols for it's own UART handlers, namely HardwareSerial class works with them deep deep down.
Because there is no 9bit frame support in HardwareSerial, I implemented my own UART init and handlers in "USART.c" and "USART_ISR.c", and the definitions of the same vectors conflict with the Arduino ones.
You need to find those in the Arduino headers/sources and comment them out, then recompile.
Also, if you need a debugging tool you can use SoftwareSerial class and a USB-UART dongle, since you won't be able to use HardwareSerial.
Did you resolve your issue?
THANK YOU I solved this problem and cleaned up the libraries. I have 2 more problems :)
I think you've gotta figure out those ones yourself, since those are not exactly the issues concerning this particular project. A couple of suggestions though:
Dear Languid, Where do I have to paste/replace all the ".c" and ".h" files. I am using Arduino IDE 1.8.6 and the only location where I am able to locate USART.c and USART.h is at the folder location
C:\Program Files (x86)\Arduino\hardware\arduino\avr\firmwares\wifishield\wifi_dnld\src\SOFTWARE_FRAMEWORK\DRIVERS\USART
Please help me with the folder locations for the files.
Also I am trying to port this code to Arduino Mega. Please let me know which file I have to edit for 9 bit serial mode.