Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 00:46 28 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Micromite Extreme: small tests

Author Message
Nathan
Regular Member

Joined: 10/01/2016
Location: Germany
Posts: 49
Posted: 04:16am 05 Mar 2017
Copy link to clipboard 
Print this post

Hi,

At the moment I'm looking for a way to get the c-cunftions running a little
bit more smooth.

Unfortnately I'm in the darkness, because I do not have a device, yet.

Please can comeone make a small test on the micromite extreme for me?

I would be interested in the ouput of the following two functions on an
extreme device.

On a Mx I will get the following:
drawCircleMX O.K.
drawCircleMZ Cpu crash

Thanks,

Nathan

drawCircleMX(100,100,20,rgb(255,0,255))
drawCircleMZ(100,100,10,rgb(0,255,0))
CSub drawCircleMX
00000000
27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
AFB20030 AFB1002C AFB00028 84840000 AFA40018 AFA40020 84A50000 AFA5001C
AFA50024 84D10000 0620003D 8CF60000 241E0001 03D1F023 00008021 3C179D00
8FA20018 0050A023 0202A821 8FA20024 02223821 8EE20048 AFB60010 8C420000
02802021 00E02821 0040F809 02A03021 8FA20020 00519023 02229821 8FA2001C
02023821 8EE20048 AFB60010 8C420000 02402021 00E02821 0040F809 02603021
8FA2001C 00503823 8EE20048 AFB60010 8C420000 02402021 00E02821 0040F809
02603021 8FA20024 00513823 8EE20048 AFB60010 8C420000 02802021 00E02821
0040F809 02A03021 1FC00005 26100001 27DE0001 00101040 10000006 03C2F021
2631FFFF 27DE0001 02111023 00021040 03C2F021 0230102A 1040FFCA 8FA20018
8FBF004C 8FBE0048 8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030
8FB1002C 8FB00028 03E00008 27BD0050
End CSub

CSub drawCircleMZ
00000000
27BDFFB0 AFBF004C AFBE0048 AFB70044 AFB60040 AFB5003C AFB40038 AFB30034
AFB20030 AFB1002C AFB00028 84840000 AFA40018 AFA40020 84A50000 AFA5001C
AFA50024 84D10000 0620003D 8CF60000 241E0001 03D1F023 00008021 3C179D00
8FA20018 0050A023 0202A821 8FA20024 02223821 8EE24048 AFB60010 8C420000
02802021 00E02821 0040F809 02A03021 8FA20020 00519023 02229821 8FA2001C
02023821 8EE24048 AFB60010 8C420000 02402021 00E02821 0040F809 02603021
8FA2001C 00503823 8EE24048 AFB60010 8C420000 02402021 00E02821 0040F809
02603021 8FA20024 00513823 8EE24048 AFB60010 8C420000 02802021 00E02821
0040F809 02A03021 1FC00005 26100001 27DE0001 00101040 10000006 03C2F021
2631FFFF 27DE0001 02111023 00021040 03C2F021 0230102A 1040FFCA 8FA20018
8FBF004C 8FBE0048 8FB70044 8FB60040 8FB5003C 8FB40038 8FB30034 8FB20030
8FB1002C 8FB00028 03E00008 27BD0050
End CSubEdited by Nathan 2017-03-06
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 05:18am 05 Mar 2017
Copy link to clipboard 
Print this post

Hi Nathan

I can confirm that the MZ CFunction works on an eXtreme.

Here is where I am at with CFunctions on the MZ, not spent much time on it though

Set up the XC-V1.33 compiler as though it is for a MX470, use normal CFunction compiler and linker switches, use the MZ .h file:

Simple CFunctions work - calls to firmware routines are OK
Floating point doesn't work
Integer divide doesn't work!

Use xc32-1.42, set the compiler for the correct MZ, compiler options as per MX except no -fPIC as this isn't accepted
floating point can work as normal code
calls to firmware routines; can't remember but may not work
anything complex fails


 
Nathan
Regular Member

Joined: 10/01/2016
Location: Germany
Posts: 49
Posted: 05:36am 05 Mar 2017
Copy link to clipboard 
Print this post

  matherp said   Hi Nathan

Use xc32-1.42, set the compiler for the correct MZ, compiler options as per MX except



Hi please try the following:

Compiler required:
-----------------------------------
XC32 Version 1.34 <---- important it must be 1.34

Compiler upgrade to get unsupported devices
-----------------------------------
Download
xc32-v1.42-part-support

Install the file into 34v not the 42v directory as the install script suggests.
(There is a dialog during install, which asks for the target location)

After that you can select the 1.34 compiler and select the extreme cpu.

Please give me a short feedback if it works.

Nathan


 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 09:09am 05 Mar 2017
Copy link to clipboard 
Print this post

No good

long long test(void){
long long a=20000;
long long b=126;
if(Option->MHz200)b=100;
long long c;
c=a/b;
return c;
}

gives

undefined reference to `__divdi3

compiler options are:
-fPIC -fno-short-double -mno-abicalls -fno-toplevel-reorder -shared -membedded-data -mno-long-calls -fno-jump-tables -mno-jals -mgpopt -Wuninitialized -Wunused-variable -Wunused-value -Wunreachable-code
 
Nathan
Regular Member

Joined: 10/01/2016
Location: Germany
Posts: 49
Posted: 10:27am 05 Mar 2017
Copy link to clipboard 
Print this post

  matherp said   No good

long long test(void){
long long a=20000;
long long b=126;
if(Option->MHz200)b=100;
long long c;
c=a/b;
return c;
}

gives

undefined reference to `__divdi3

compiler options are:
-fPIC -fno-short-double -mno-abicalls -fno-toplevel-reorder -shared -membedded-data -mno-long-calls -fno-jump-tables -mno-jals -mgpopt -Wuninitialized -Wunused-variable -Wunused-value -Wunreachable-code


Hi Peter,
I expect you will get the same error/limitation on a PIC32MX device, too.
The hardware divider is 32 by 16bit as far as I remember.
So the division of the long long will be build up in a library call.

__divdi3 is part of the std lib, which is disabled.
EXCLUDE Standard libraries. (cross)

A possible workaround is to make the __divdi3 and some more functions available by the MZCFheader.h file. So you have to force __divdi3 to a fixed address.

By the way
long a
long b
will work.

Nathan
Edited by Nathan 2017-03-06
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024