Skip to content
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

Fails to perform check for code size #106

Closed
propeller3D opened this issue Sep 3, 2023 · 1 comment
Closed

Fails to perform check for code size #106

propeller3D opened this issue Sep 3, 2023 · 1 comment

Comments

@propeller3D
Copy link

I had an issue where inlining a class method made the code too big to fit on the teensy 4. There are checks performed here for code size: https://github.com/PaulStoffregen/teensy_size/blob/main/teensy_size.c#L99

If the code is too big it should return an error and not upload. In my case platformio compiled the program and uploaded, it worked for 2 seconds and then the program crashed and the teensy was unresponsive. Only way to recover it was to press the reset button and re upload working code. If I just build but not upload the ”free for local variables” was showing a negative value.

@PaulStoffregen
Copy link

For reference, Arduino IDE properly checks the return status from teensy_size.

screenshot

The build is considered to have failed if teensy_size returns non-zero. PlatformIO should do the same.

Here is the code shown in the screenshot.

volatile uint8_t bigbuf[500*1024];

void setup() {
}

void loop() {
  bigbuf[random(sizeof(bigbuf))] = random(256);
}

@valeros valeros closed this as completed in b003257 Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants