CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Apple Silicon

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

Apple Silicon
PostPosted: Tue Apr 29, 2025 3:58 pm     Reply with quote

I have been running Apple for a very long time. Running Paralells VM and mplab and Mplab x. I have recently bought a new M4 chip Apple and though I had it all figured out until i had a weird thing starting to happen when i compiled . Using CCS 5.118 right now . Floating point numbers are not working out. I set a float as , lets say 14.26 , it outputs it as 0.26.

I have done some reading and I am not sure if this is fixable or not.

Keep in mind, same code last computer with Intel Silicon, same number shows 14.26.

This is in debug as well as a printf...

Any help would be great....
Ttelmah



Joined: 11 Mar 2010
Posts: 19809

View user's profile Send private message

PostPosted: Wed Apr 30, 2025 1:03 am     Reply with quote

How long have you been trying????.
What version of Windows are you running????

I use Apples. Have a 12core Xeon, a I7, and a 10core M4. On all I use
Parallels as you describe.
However recently things have gone wrong on all the machines. The Intel
ones are doing a memory dump on shutdown, and the M4, is giving weird
problems.
This started with release 20.2.2, and is still happening with 20.3.2.
It seems to be less of a problem on W10, than W11. Hence second
question. I had W10 ARM installed, so can use this.
I've stepped back to 20.2.0, and Parallels are working on the problem.
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

PostPosted: Wed Apr 30, 2025 8:08 am     Reply with quote

Windows 11
Parallels 20.3.0
Apple M4 Silicon macbook Pro
macOs 15.4.1 Sequoia
MPLABX 6.25
CCS 5.118
PIC 24EP512GP206

Been trying for a day. I just got the computer and built it last week. Thought everything was going good until i needed to fix a bug in some code and floats are not being treated correctly.
float thisFloat = 14.23;

^^^ this will come out as 0.23. moved the number to 678.23 and it comes out as 1024.23. Putting 14 in comes out as 14.0

I have never had an issue in the past. Been using a mac now for about 11 years.

**** I put 20.2.0 on with no success.
Ttelmah



Joined: 11 Mar 2010
Posts: 19809

View user's profile Send private message

PostPosted: Wed Apr 30, 2025 9:35 am     Reply with quote

It may have been the Sequoia update that happened at about the same time
that triggered it.
Is this in MPLAB simulation, or on a physical chip and serial?.
There have been problems before with the simulation.
Will have a play and see if I can duplicate your problem, but it has been
faulty now for a couple of weeks. I just switched to using my laptop.
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

PostPosted: Wed Apr 30, 2025 9:46 am     Reply with quote

Possibly , since it was a new computer everything got updated.

I'm installing a windows 10 image on the VM and mplab and ccs only on it to see if that fixes anything.

I also tried all the emulation settings in properties. to no avail.
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

PostPosted: Wed Apr 30, 2025 11:03 am     Reply with quote

Nope cant go to Windows 10 on this. parallels wont let me. Crap. I guess my silicon wont support it.
Ttelmah



Joined: 11 Mar 2010
Posts: 19809

View user's profile Send private message

PostPosted: Thu May 01, 2025 5:59 am     Reply with quote

It has to be Windows 10 ARM. Unfortunately I know that MS removed the
download for this. It was always only really a preview, and they decided to
not allow it any more.
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

PostPosted: Thu May 01, 2025 9:33 am     Reply with quote

Are you saying W11 wont work?

So CCS is not working on W11 only on ARM?

Still might be a parallels issue that they are working on?
Ttelmah



Joined: 11 Mar 2010
Posts: 19809

View user's profile Send private message

PostPosted: Thu May 01, 2025 10:38 am     Reply with quote

You have not answered whether this is on a real chip, or in the simulator?.
The compiler itself, I have had working on the M4, at various points with
Parallels and Windows ARM. I have had huge problems with MPLAB
(hence the question about whether this is with the simulator}. However
things seem to gave got much worse with the latest release of Parallels
and with the new release of Sequoia. This has killed the operation of
a lot of USB devices, and the Parallels seems to have memory management
and display problems from simulated apps. Things that were working a
few weeks ago, have stopped, so I've reverted to using the Intel Macs
for this while sending support requests backwards and forwards,
curt2go



Joined: 21 Nov 2003
Posts: 206

View user's profile Send private message

PostPosted: Thu May 01, 2025 11:33 am     Reply with quote

Sorry about that.

Real chip. MPLAB seems to be working fine . Since its using CCS compiler i thought the issue would most likely be the compiler.

Using ICD-4 , works in debug as well.

Everything seems fine except the floats. Its totally weird.

The exact code compiles properly on intel chips. Old MAC , W10 , intel processor. Debugs properly with floats fine.
Ttelmah



Joined: 11 Mar 2010
Posts: 19809

View user's profile Send private message

PostPosted: Fri May 02, 2025 2:09 am     Reply with quote

OK.
This is very odd. Understand that with Windows ARM, it is the Windows that
actually handles the processor virtualisation, to allow Intel applications to
run in the ARM silicon. Parallels then allows this OS to run inside the Mac
OS. Now most of the problems I have seen with the visualisation are things
like display issues, some of stack crashes when running applications etc..
There seem to have been some real oddities introduced in the latest release
of Sequoia, both on the ARM, and on Intel. I've had USB devices stop
working, or run for a while and then refuse to restart (quite a few people
are reporting these). It could be a stack issue happening inside the compiler.
Problem generally, is so many things get updated one after the other and
tracking which has caused an issue gets very hard. Sequoia, Parallels, and
the Windows itself.
Some thoughts:

First you say the code ran OK. Is that using the same compiler?. One silly
thought, is it could simply be that a change on the compiler is resulting in
the stack in the PIC overflowing on the float operations. Float and printf
are amongst the heaviest stack users on the PIC, Might just be worth
trying with the stack expanded a little. Default on your compiler would be
256 bytes, and on large projects I've seen the stack have to go to over
2KB on some code.
Now the emulation is a layer called Prism. Generally issues here are with
stuff that is more complex (I/O etc.), than with a simple program like the
actual compiler. I have seen issued with MPLAB on it's screen behaviour,
and on the CCS IDE as well in the same areas. Doing things like pulling
out menus. This is why I wondered if your actual issue might be with
something more complex like the simulation.

I'd suggest something really basic.
Compile the program and save the hex file.
Then compile with the same compiler on an Intel machine.
Do a file comparison between the results.
If the hex files are the same, then your issue is with something like
the act of programming, rather than with the compiler.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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