Open mcspr opened 4 years ago
Hi Max,
Thanks for your support... I am not the GCC expert, so, let me investigate it...
I think the compiler is just running out of registers. ASM blocks in read() and write() use 14 registers. Even with the old compiler, I got the RL_REGS error when I tried to add a 15th. The best fix is to rewrite assembly with fewer registers. For example, error and repeated-start flags can be in RAM without slowing the execution.
@beefeater94 : Well, the point is not that I do not understand what the compiler is saying, i.e. no more registers. However, the question is why this version of GCC behaves differently and which compiler flags cause thise different behaviour compared to older versions. Thus, changing flags comes before changing code ;-)
You should be able to just save and restore registers in the assembly code and it would not matter how many registers you use as long as the code was single threaded (ie. save registers - run code - restore registers - exit). I have no idea why a compiler would care about register usage - but I am an assembly guy, not a high level language user.
Hey,
ESP8266 Arduino Core project plans to use current version of GCC as default some time soon, but something had changed in compilation process since 4.8.2 and brzo can no longer build.
https://github.com/esp8266/Arduino/pull/6294 https://github.com/earlephilhower/esp-quick-toolchain/releases
I commented on the GCC issue directly in hope it was something noticed during the migration of the Core sources, but it was suggested I should post here. Building using PIatformIO.
I also noticed https://github.com/pasko-zh/brzo_i2c/issues/9#issuecomment-246939228, but I have no idea what exactly is missing from flags / defines. ICACHE_RAM_ATTR seems to be there, optimization flags do not change anything.