'USART_RS485_bm' was not declared in this scope #258
Replies: 1 comment 1 reply
-
You did a manual installation, but you skipped the step of updating the toolchain, and are using the ancient (20+ months old - summer 2020) version of the toolchain that Arduino is still distributing It's based on a very early ATpack wherein the headers defined two RS485 bits, one to enable the normal RS485 mode that remains in the datasheet, and the other to enable the... other... rs485 mode. That mode is described in the tinyAVR 0/1-series datasheets and the megaAVR 0-series datasheets, but not in more recent parts (the bit is marked reserved. I would bet money that it is works exactly the same way on the newer parts as on the ones that have it as a documented feature). In normal RS485 mode, and the only one that the documentation described and that recent headers contain, you set USART_RS485_bm in one of the USART registers and set XDIR output, and connect to the transmit enable pin of your transciever. In the other mode, only described in the documentation for older parts, a system is described wherein an external device manipulated that pin, it's set as an inpt, and controls when the TX drivers are enabled. It's a configuration that raises all sorts of questions (what happens when the pin turns off TX halfway through a byte, for example? I can't think of a way to specify the behavior of a mode like that which is coherent and self-consistent. I don't know WTF they implemented, but I don't think it worked as well as they hoped, they realized nobody really cared about that feature anyway, "removed it with a pencil" rather than document it better (the docs in the parts that have them are very terse, usually indicative of the person in documentation not knowing how it worked either - there are a couple of cases of that in the datasheets for the modern AVRs) But yeah, the version of the toolchain package that has it defined as a two bit wide bitfield instead of a single bit also doesn't support a whole bunch of parts that have been in produiction for a while now. That's why I build my own toolchain packages! |
Beta Was this translation helpful? Give feedback.
-
C:\Users\pc de marco\Documents\Arduino\hardware\DxCore-master\megaavr\cores\dxcore\UART.cpp:395:15: error: 'USART_RS485_bm' was not declared in this scope
if (ctrla & USART_RS485_bm) { // RS485 mode recorded here too... because we need to set
Hi,
the core has been installed manually
if I add :
#define USART_RS485_bm 0x01 /* RS485 Mode internal transmitter bit mask. */
in the UART.cpp file, it compiles ; but ...
Beta Was this translation helpful? Give feedback.
All reactions