Skip to content

[NUCLEO_xxx] Fix issue with us_ticker_read() when -O3 -Otime options are used. #166

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

Closed
wants to merge 2 commits into from

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Feb 17, 2014

No description provided.

@adamgreen
Copy link
Contributor

What was the nature of the issue that this commit is fixing? When I see code changes like this, I am pretty suspicious that there is just a bug in the code which is being covered up. One thing I notice is that the static SlaveCounter variable is referenced in both an IRQ handler and us_ticker_read() but yet doesn't have a volatile qualifier.

@bcostm
Copy link
Contributor Author

bcostm commented Feb 17, 2014

The issue is that the wait timing is not correct when the -O3/-Otime is used. I have already made a test with volatile on the SlaveCounter variable but it didn't solve the problem. I didn't have the time yet to investigate in detail inside the assembly code. This is why I used the pragma -O0/-OSpace as a quick workaround.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 17, 2014

Hi,

@bcostm : can you be more specific how incorrect is it? What times do you get with other optimization levels? I would add volatile qualifier as Adam suggested.

Regards,
0xc0170

@emilmont
Copy link
Contributor

Declaring SlaveCounter as volatile is a better solution.

@emilmont emilmont closed this Feb 17, 2014
bridadan pushed a commit that referenced this pull request Jun 21, 2016
- Semaphore returns 0 on timeout, and negative was incorrect used for
  errors
- Correctly checked error code on tcp_connect

thanks to @LiyouZhou
fixes #284, fixes #285, fixes #166
geky added a commit to geky/mbed that referenced this pull request Jul 22, 2016
- Semaphore returns 0 on timeout, and negative was incorrect used for
  errors
- Correctly checked error code on tcp_connect

thanks to @LiyouZhou
fixes ARMmbed#284, fixes ARMmbed#285, fixes ARMmbed#166
yossi2le pushed a commit to yossi2le/mbed-os that referenced this pull request Mar 27, 2019
* Add macros to help define offsets in config
* Use build system provided macros for flash size and addr
pan- added a commit to pan-/mbed that referenced this pull request May 29, 2020
Updating mbed-os to mbed-os-5.9.3
ccli8 pushed a commit to ccli8/mbed-os that referenced this pull request Aug 13, 2024
The workaround is not needed anymore (v32 is breaking this reindexing as they created new command to do that anyway).

Co-authored-by: Martin Kojtal <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants