STM32F105 unsigned division wrong result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-05 12:41 AM
Hello community,
- Processor : STM32F105 (Cortex M3)
- Compiler : GCC 6.3.1
I would like to execute the following assembly instruction :
udiv R3,R2,R3
where :
- R2 = 64 000 000
- R3 = 1
Instead of getting R3 = 64 000 000, I get R3 = 2047
I tried to execute strictly the same instruction in another part of the code and it works. I thought that the flash segment could be inconsistent but no other calculation is wrong in this part of the flash. I also tried to set manually the value of the memory where the PC points where this instruction is flashed and it works
I'm pretty sure that issue is hardware related because I have other STM32F105 which run the same code and the result of this division is correct.
Any idea on where the issue comes from ?
Thank you community
- Labels:
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-05 12:56 AM
How is R1 involved?​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-10-05 12:59 AM
Sorry typing error. It should be R3 of course. I fixed it
