 |
 |
| View previous topic :: View next topic |
| Author |
Message |
allenhuffman
Joined: 17 Jun 2019 Posts: 648 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: 20025
|
|
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: 9619 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 ? |
|
 |
allenhuffman
Joined: 17 Jun 2019 Posts: 648 Location: Des Moines, Iowa, USA
|
|
Posted: Mon Jan 26, 2026 4:40 pm |
|
|
| temtronic wrote: | | just curious... why did you install the upgrade? Did it fix a 'bug' for you ? |
Co-worker at HQ set up their system to build PIC24 code and had to install the compiler. The setup program downloads the current stuff, which is how we found the issue. (I save out all the DLLs as updates come in, and was able to provide them with the 5.118 to use, and CCS was able to provide me with several I missed updating to so I could archive those as well.)
We have had numerous compiler quirks over the years that CCS has quickly resolved and provided an update, including this time with them giving me a pre-release 5.123 to test out.
This is the first time we've encountered a "new" issue after an update, at least. Usually we have some code that trips up the compiler and we have to upgrade to get the fix ;-)
5.123 is out, though I have not tested it on the original code. The pre-release 5.123 seemed to cause an unrelated issue elsewhere, but I haven't had time to diff the list files and see what changed (beyond the division code). _________________ 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. |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|