-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Metro-M4 problems with gcc 7.2.1 #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I kept pruning the program back. The problem appears to be much more fundamental, and appears to have to do with storage allocation or garbage collection. This program hangs around i=479:
Interestingly, it doesn't fail in the repl, but does fail if named as, say |
Have you tried this with a debugger hooked up to see where it is in C land? |
going to do that - just wanted to redirect where to look. It's doesn't seem like it's IO or USB or something like that. I have a feeling it's something that got optimized out or misplaced even though it's "asm"d or something like that. |
Yup, thats my feeling too. I'll assign to you. |
(this diagnosis filed as issue in (also filed in micropython#3526) We recently starting using the gcc-arm-none-eabi-7-2017-q4-major toolchain, which uses gcc 7.2.1. We also use The ARM calling conventions are that In the M0 assembly code, and in non-LTO compilations, I'm not sure if this is an actual compiler bug or simply a pathological case due to asm-jumping from a If I put in a regular call to something else before I'm writing this down as a warning to others for now. I have to think of some way to fix this. I was thinking about using local register variables and rewriting
|
I believe I have fixed this by using the Other things I tried included removing the The best way to look at the assembly code is to use
|
Code after fix:
|
Is any of this specific to the M4 ? Rephrased, is there some reason why the M0 code does not generate these errors or were we just lucky. |
It should be just about the same (both are thumb), but it's a different cpu setting, so maybe there's some difference in the cpu description tables. I did check the asm for both, and the M0 didn't have the mistake that the M4 compilation did. I may look further at some point. |
After updating my linux system to the latest arm-none-eabi-gcc toolset (7.2.1) I have been experiencing some odd behavior when executing a build of CP 3.0 master on my Metro-m4-express.
The compile and upload run with no problems and I can enter the REPL on the M4. When I execute some scripts, the system will run for awhile then apparently hang and after about 30 seconds, it disconnects the USB port. It can be restored by a RESET.
I recompiled CP 3.0 master with gcc 6.3.1 and everything works properly.
I have compiled CP 2.x for several M0 boards with gcc 7.2.1 and have not seen any problems.
Also I have compiled CP 3.0 master for the feather nrf52 board (also an M4) and have not experienced any problems (but my testing of it has been minimal).
Note that CP 3.0 master compiled with gcc 7.2.1 for the metro-m0-express also works without any problems.
I am attaching 2 scripts that cause hangs - the BMP280_test.py runs an report 3 full samples then on the 4th sample it hangs after reporting the Temperature. -- this is repeatable ...
the ring.py script displays a color wheel on a 16 element neopixel ring. It hangs immediately and none of the neopixels even get illuminated.
I have also caused it to hang via the REPL by setting up the BMP280 and making repeade reads. After several successful reads, it hung as before.
bmp280_test:
ring.py:
The text was updated successfully, but these errors were encountered: