Hello
I was just now trying to see which hardwareserial.h (there are 6 of them in my HDD- lets forget this) is used by the IDE.
So I have a mega2560, i try one after the other and see in compilation of specific sketch how much memory is used. ok i got it.
initial value was rx 256, tx 256 (it seems I had change in past) : Compilation message (I translate from greek) : global variables use 3117 bytes
change values to rx 64, tx 64 : Compilation message : global variables use 1965 bytes
That is a difference 3117-1965=1152bytes
256-64=192 bytes "each" buffer
1152/192 = 6 buffers
Mega 2560 has Serial, Serial1, Serial2, Serial3 : 4 ports *2 buffers =8
Am I missing something or one port is not affected (which one?)
GRuser:
I was just now trying to see which hardwareserial..........is used by the IDE.
Am I missing something
Probably quite a lot, your post is incoherent nonsense, and I suspect you are trying to make something simple hard. The IDE talks to a Mega via Serial, pins 0,1, just like any other Arduino.
Have you modified the serial to use larger buffers? If so, you will have to look at the modified file to see what you did to each port, noone here can see your modified files.
Nick_Pyner:
Probably quite a lot, your post is incoherent nonsense, and I suspect you are trying to make something simple hard. The IDE talks to a Mega via Serial, pins 0,1, just like any other Arduino.
if you do not understand what is written, it doesnt mean it is "nonsense". just try a little harder
david_2018:
Have you modified the serial to use larger buffers? If so, you will have to look at the modified file to see what you did to each port, noone here can see your modified files.
ok here is the change at the top of hardwareserial.h
....
// often work, but occasionally a race condition can occur that makes
// Serial behave erratically. See https://github.com/arduino/Arduino/issues/2405
#define SERIAL_TX_BUFFER_SIZE 256
#define SERIAL_RX_BUFFER_SIZE 256
#if !defined(SERIAL_TX_BUFFER_SIZE)
#if ((RAMEND - RAMSTART) < 1023)
#define SERIAL_TX_BUFFER_SIZE 128
#else
#define SERIAL_TX_BUFFER_SIZE 256
#endif
#endif
#if !defined(SERIAL_RX_BUFFER_SIZE)
#if ((RAMEND - RAMSTART) < 1023)
#define SERIAL_RX_BUFFER_SIZE 128
#else
#define SERIAL_RX_BUFFER_SIZE 256
#endif
....
Find your .elf file and your binaries directory and do the equivalent of:
avr-nm -SC /tmp/OldArduBuild/myprog.ino.elf |grep Serial
Serial ports that aren't used are garbage-collected from the final binary, so I surmise that your sketch that reduced in size by only 3 Serial's worth probably only used 3 Serials...
Sketch that uses both "Serial" and "Serial1":
avr-nm -SC /tmp/OldArduBuild/ASCIITable-mod.ino.elf |grep Serial
00800342 0000009d b Serial
008002a5 0000009d b Serial1
0000038a 00000012 t Serial0_available()
00000378 00000012 t Serial1_available()
w Serial2_available()
w Serial3_available()
0000039c 00000044 t HardwareSerial::_tx_udr_empty_irq()
000002fe 0000001e t HardwareSerial::availableForWrite()
00000344 0000001c t HardwareSerial::peek()
0000031c 00000028 t HardwareSerial::read()
00000254 0000004e t HardwareSerial::begin(unsigned long, unsigned char) [clone .constprop.20]
00000478 00000042 t HardwareSerial::flush()
000003e0 00000098 t HardwareSerial::write(unsigned char)
00000360 00000018 t HardwareSerial::available()
00800202 00000012 d vtable for HardwareSerial
Blink sketch (which of course uses no serials at all)
WWHackintosh<1494> avr-nm -SC /tmp/OldArduBuild/Blink.ino.elf |grep Serial
(nothing is here!)
Robin2:
I might have used softer language but my conclusion is exactly the same as @Nick_Pyner
If you want help then it is your task to try very hard so we don't have to. We are not being paid to help you.
...R
so, if you dont understand the issue (whatever the reason (too complex, nonsense, foreign language, out of site scope....), dont help.
if you dont understand the issue but you want to get paid to solve it, then suggest a transfer to "gigs and collaboration".
everybody has the right to have opinion. The right and the opinion should be (and is- by me-) respected.
No member is oblidged to spend time in order to think a solution to another member;s problem. But, if a member wants to involve and thinks that the "data" given by the OP is not sufficient, he can ask for more details.
it is tottally impolite for anybody to say that somebody else;s writing is nonsense.
Well, that is my opinion and I expect it should be not critisised.
at #2, david_2018 asks for details and I respond.
Anyway
Although I disagree , I will not stop to support the right for everybody to have his/her opinion.
pls do not continue posting, the issue is solved. Because Im considered newbie I cannot edit the initial subject to wright [solved] in.
thank you