USBserial don't works - what's wrong?

User avatar
mrburnette
Posts: 1788
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: USBserial don't works - what's wrong?

Post by mrburnette » Wed Jan 18, 2017 2:21 am

vde wrote:That bugs are very rare, and moreover a lots of programs which works fine after 5.4 now even don't starts after 6.1. Surprise :mrgreen:
There is a Standards organization that set the "rules" for C++ and these rules are incorporated into new releases of GCC, the compiler/linker used under ArduinoIDE.

The ArduinoIDE folks have been steadily moving the original IDE closer and closer to the ever-moving "standard" for years... for some, it has been like light speed and for others, it has been a snail-pace!

For the Arduino Community, changes can be difficult; stuff works OK in an older version but the IDE tosses all manner of errors/warning on just a simple '.1' upgrade. But, this is the price the programmer pay for evolution. If we do not like it; we should use professional tools that allow us to "tune" the compiler/linker and often even suggest the correct revisions necessary to comply with changing standards.

Now, the Arduino folks know the truth; so they allow one to download older versions of the IDE+tools. I always specify the ArduinoIDE version for my code ZIP in my online sources - thus, if the reader that download my source is having an issue, s/he can download the IDE/tools to successfully compile my project from arduino.cc

A large part of being more than a weekend coder is understanding the full responsibility of dealing with evolving tools and coding standards. It's part of growing-up and maturing to understand the scope of responsibility that a programmer has for their code. In a large corporate environment, a large amount of the program maintenance cycle is dealing with testing and code 'tweaking' that is necessary during the program lifecycle.

Ray

fredbox
Posts: 91
Joined: Tue Jul 07, 2015 4:44 pm

Re: USBserial don't works - what's wrong?

Post by fredbox » Sat Jan 21, 2017 5:21 pm

For the Arduino Community, changes can be difficult; stuff works OK in an older version but the IDE tosses all manner of errors/warning on just a simple '.1' upgrade.
True. The latest 1.8.1 compiler throws all sorts of warnings that weren't there on 1.6.x, but my program still works as it always did.

vde
Posts: 13
Joined: Wed Jan 11, 2017 3:28 pm

Re: USBserial don't works - what's wrong?

Post by vde » Mon Jan 23, 2017 11:21 am

There is a Standards organization that set the "rules" for C++ and these rules are incorporated into new releases of GCC
It's the philosophy which does not help in answering the question "why the VCP does not work with less ancient compiler"

stevestrong
Posts: 1350
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: USBserial don't works - what's wrong?

Post by stevestrong » Mon Jan 23, 2017 12:49 pm

stevestrong wrote:@vde
you could also help by posting the disassembled version of the questioned USB module(s) for both compiler versions, just to easy our collective work, as we are doing all this in our free time...

User avatar
Rick Kimball
Posts: 895
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: USBserial don't works - what's wrong?

Post by Rick Kimball » Mon Jan 23, 2017 4:00 pm

vde wrote:
There is a Standards organization that set the "rules" for C++ and these rules are incorporated into new releases of GCC
It's the philosophy which does not help in answering the question "why the VCP does not work with less ancient compiler"
When I used to use the msp430, I had problems getting the TI usb code working on the msp430-gcc compiler. Even though all the code was 'C' based and worked on the TI compiler, it didn't work on GCC. After I spent much time understanding the code and understanding each compiler. I realized that the TI programmer made assumptions about structure alignment which caused the code to fail. Neither compiler violated the standard, it was the programmer who made assumptions about the alignment that made the whole thing break. Once I forced the alignment on msp430-gcc to work like the TI compiler it worked.

I haven't looked at the libmaple USB code in depth. However, I would guess the programmer probably made assumptions about how the compiler worked at the time he wrote the code. Newer versions of the compiler or flags we are using might change those assumptions. As the original people who wrote the code are no longer involved, we can only guess what those assumptions might be. As stevestrong pointed out, you would probably have to look at the generated assembler code to see how the new compiler differs from the old one. It is pretty simple, compile it with the old compiler, use arm-none-eabi-objectdump -CS foo.elf >old.txt and then compile with the new version and do the same, then do a diff between them.
# compile with old then dump
$ arm-none-eabi-objdump -CS foo.elf >foo.old
# compile with new version then dump
$ arm-none-eabi-objdump -CS foo.elf >foo.new
# compare
$ diff foo.new foo.old
-rick
-rick

User avatar
RogerClark
Posts: 6132
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USBserial don't works - what's wrong?

Post by RogerClark » Mon Jan 23, 2017 10:04 pm

Rick

Judging by the PR for to fix the bootloader to make it work with gcc 5.2, there were differences in when the compiler put stuff onto the stack, which caused that particular issue, so I'm sure there are loads of internal differences between compiler versions.
Hence why code normally indicates which compiler (and version) is required.

e.g the bootloader fix was
https://github.com/rogerclarkmelbourne/ ... 86dc865f18

I find it a bit odd that people expect to be able to update the compiler to a version which is not supported, and then complain that things don't work.

Likewise, people complain that the core doesnt work correctly with Platformuino or VisualStudio etc, despite the Readme explicitly saying that the core works with a specific version of the Arduino IDE (and hence people should presume that it won't necessarily work with any other IDE or compiler that they fancy using)

victor_pv
Posts: 1341
Joined: Mon Apr 27, 2015 12:12 pm

Re: USBserial don't works - what's wrong?

Post by victor_pv » Mon Jan 23, 2017 11:14 pm

RogerClark wrote:Rick

Judging by the PR for to fix the bootloader to make it work with gcc 5.2, there were differences in when the compiler put stuff onto the stack, which caused that particular issue, so I'm sure there are loads of internal differences between compiler versions.
Hence why code normally indicates which compiler (and version) is required.

e.g the bootloader fix was
https://github.com/rogerclarkmelbourne/ ... 86dc865f18

I find it a bit odd that people expect to be able to update the compiler to a version which is not supported, and then complain that things don't work.

Likewise, people complain that the core doesnt work correctly with Platformuino or VisualStudio etc, despite the Readme explicitly saying that the core works with a specific version of the Arduino IDE (and hence people should presume that it won't necessarily work with any other IDE or compiler that they fancy using)
I find it ever more odd that some people not only expect it to work, but when it doesn't work, request a solution to be provided by someone else with no effort on their part. As if someone has been paid to work on their problem so they are entitled to that someone resolving it for them.

User avatar
RogerClark
Posts: 6132
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USBserial don't works - what's wrong?

Post by RogerClark » Tue Jan 24, 2017 1:29 am

Victor

This situation happens a lot.

People seem to treat open source software as if it was commercial software they paid for and offered service level guarantees and free support.

I find I get random questions in comments to my blog, and to my youtube videos and also emails direct to me (often via youtube), as if I offer some free support service for anything related to STM32, nRF51 or microcontrollers etc in general.

I've given up replying to these, as I have had personal abuse for pointing out that its open source / free / non commercial and its up to them to fix it if it doesn't happen to work for their person configuration.

User avatar
mrburnette
Posts: 1788
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: USBserial don't works - what's wrong?

Post by mrburnette » Tue Jan 24, 2017 2:26 am

victor_pv wrote: ...
RogerClark wrote: ...
I find it a bit odd that people expect to be able to update the compiler to a version which is not supported, and then complain that things don't work.

Likewise, people complain that the core doesnt work correctly with Platformuino or VisualStudio etc, despite the Readme explicitly saying that the core works with a specific version of the Arduino IDE (and hence people should presume that it won't necessarily work with any other IDE or compiler that they fancy using)
I find it ever more odd that some people not only expect it to work, but when it doesn't work, request a solution to be provided by someone else with no effort on their part. As if someone has been paid to work on their problem so they are entitled to that someone resolving it for them.
Roger will remember that he and I had this same conversation in a PM over a year ago. It is the primary reason that I deleted my Arduino.cc account. I am rarely active here anymore simply because I find it far less fun than when the STM32 thrill was young. But, I generally try and read the majority of posts.

I too have had nasty PM's because I did not assist a newbie with some concept or futuristic project or collaboration! After a while, it all gets a bit stressful.

Ray

User avatar
RogerClark
Posts: 6132
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: USBserial don't works - what's wrong?

Post by RogerClark » Tue Jan 24, 2017 4:00 am

Thanks Ray

It did stress me out for about 5 mins, but now that I just delete any such email, I got some of my life back ;-)

I get enough stress with work (being freelance) that I don't need additional load and stress from people I don't know, making unreasonable demands of me.

But I consider it their problem not mine.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest