SpenceKonde / ATTinyCore

Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Other
1.58k stars 306 forks source link

Can't get Serial to work #701

Closed NickD9 closed 2 years ago

NickD9 commented 2 years ago

librarySerial.ino.txt

Spence, I uploaded a file containing the text of an INO which tries to use the Serial option (using AIN0 and AIN1). This doesn't work when I use ATtinyCore, but does work when I use the DIY fork of your library. Any ideas? I'm using an ATTiny85 8 pin chip.

SpenceKonde commented 2 years ago

Serial breaks because of a compiler bug in the released version, this is already fixed for for 2.0.0 and is a duplicate for #475.

I don't understand WHY the fix works, but it has something to do with how the stack pointer is handled (I spent many hours studying the assembly listings tryign to figure out what changed - but workarounds that fix it cause tons of changes all over the generated code, so while I found about half a dozen instructions that were always present when it worked and never when it didn't work, I wasn't able to figure out exactly what they do or why they fix the bug. 2.0.0 was planned for release long ago, but I have been so busy with megaTinyCore and DxCore plus commissions for clients that I haven'[t had a chance to push 2.0.0 over the finish line. The current biggest blocking issue is that I can't make the automated CI work.

Automated CI of some sort - at least something I can run overnight locally, is required before release to compile test all configurations, because of the huge increase in complexity in 2.0.0 (it seeks to fix all the gaps in coverage that the older versions had, and exposes a ton of functionality that is inaccessible in the released version. The boards.txt file for 2.0.0 is generated by a 1870 line python script, which co-generates the 6500 line boards.txt, 4900 line optiboot makefile, and the batch file to run all 590ish builds of optiboot that it comes with, and there's another script to build like 300 versions of micronucleus..... So it's just an absolutely massive task that I've been working on for years whenever I get any spare moment.