| View previous topic :: View next topic |
| Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 645 Location: Des Moines, Iowa, USA
|
| PCD 5.122 issues with division (revert to 5.118 to fix) |
Posted: Mon Jan 19, 2026 9:27 am |
|
|
Just a heads up. We encountered an issue with the 5.122 compiler that caused one of our four PIC24 projects to fail. Reverting to 5.118 worked.
Thanks to the excellent support from CCS, they were able to identify the issue with some division code. I had to do with using U16 integers and U32s, such as when you have something like this:
| Code: | uint32_t sum;
uint16_t average;
average = (sum / x); |
(I may not fully understand the issue, but it has something to do with how the smaller ints are supposed to expand for the calculation.
We caught this in a 24EP256GP202 and (using an updated DLL they sent me for testing) 24FJ256GA106.
Just a heads up. _________________ Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20019
|
|
Posted: Mon Jan 19, 2026 11:12 am |
|
|
Try one thing.
Recompile with the new compiler, with the optimisation turned down.
If this fixes it, it sounds as if they may have re-introduced a problem they
has with optimisation a while ago:
[url]
https://www.ccsinfo.com/forum/viewtopic.php?t=59695
[/url] |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9615 Location: Greensville,Ontario
|
|
Posted: Mon Jan 19, 2026 8:19 pm |
|
|
| just curious... why did you install the upgrade ? Did it fix a 'bug' for you ? |
|
 |
|