chipKIT® Development Platform

Inspired by Arduino™

Where can I download MPIDE0022?

Created Tue, 11 Aug 2015 21:13:10 +0000 by JackZ


JackZ

Tue, 11 Aug 2015 21:13:10 +0000

Hi everyone,

I have a program that was written in MPIDE0022. It does not work in MPIDE0023 now. Where can I download the 22 version please?

Thanks, Jack


EmbeddedMan

Tue, 11 Aug 2015 21:45:25 +0000

JackZ,

I don't know that we've ever made a 0022 release of MPIDE. The earliest ones I know about are mpide-0023-windows-20120903.

*Brian


JackZ

Tue, 11 Aug 2015 23:36:00 +0000

JackZ, I don't know that we've ever made a 0022 release of MPIDE. The earliest ones I know about are mpide-0023-windows-20120903. *Brian

Thank you Brian! Actually I was trying to modify this code. http://labscriptsuite.org/hardware/pineblaster/

The author of this code said that they used MPIDE 0022 in the readme.txt file. Here is what it said:

"Tested on MPIDE 0022 - 2011.12.14.

One modification is required: compiler optimisations must be disabled. This is required so that the compiler doesn't produce unpredictable code, or multiple code paths for the same bit of source code. So we do this to ensure our code is deterministic.

To disable compiler optimisations, edit <MPIDE_folder>/hardware/pic32/platforms.txt and replace all instances of '-O3' with '-O0'."

The code did not work in MPIDE0023. I tried to do the modification in MPIDE 0023, but did not find anything called '-O3' in the platforms.txt. Do you know whether this matter or not please?

Thanks, Jack


EmbeddedMan

Wed, 12 Aug 2015 00:37:54 +0000

Jack,

In recent versions of MPIDE (like the most recent test version here :

https://chipkit.s3.amazonaws.com/builds/mpide-0150-windows-20150801-test.zip

You will fine a file called platform.txt (in mpide-0150-windows-20150801-test\hardware\pic32\platform.txt) that has several lines like

compiler.c.flags=-O2 -c -mno-smart-io -w -ffunction-sections -fdata-sections -g3 -mdebugger -Wcast-align -fno-short-double -fframe-base-loclist

and

compiler.cpp.flags=-O2 -c -mno-smart-io -w -fno-exceptions -ffunction-sections -fdata-sections -g3 -mdebugger -Wcast-align -fno-short-double -fframe-base-loclist

If you change the -O2 to -O0, it will disable all optimizations.

Now, as a separate issue, I take issue with the way the author of pineblaster thinks the compiler's optimizations work. "Non-deterministic" means that you can't be sure, from one run to the next, what path the code will take (or how long it will take), even given exactly the same inputs. Turning on optimizations does NOT create non-deterministic code. Even with full optimizations turned on (-O3), given the same inputs, the code will run exactly the same each time.

What I think the author meant is that turning on optimizations will make following the assembly output very difficult for us poor humans, and that is it much harder to predict the exact timing of a particular section of code with optimizations turned on.

*Brian


JackZ

Wed, 12 Aug 2015 13:46:58 +0000

Jack, In recent versions of MPIDE (like the most recent test version here : https://chipkit.s3.amazonaws.com/builds/mpide-0150-windows-20150801-test.zip You will fine a file called platform.txt (in mpide-0150-windows-20150801-test\hardware\pic32\platform.txt) that has several lines like compiler.c.flags=-O2 -c -mno-smart-io -w -ffunction-sections -fdata-sections -g3 -mdebugger -Wcast-align -fno-short-double -fframe-base-loclist and compiler.cpp.flags=-O2 -c -mno-smart-io -w -fno-exceptions -ffunction-sections -fdata-sections -g3 -mdebugger -Wcast-align -fno-short-double -fframe-base-loclist If you change the -O2 to -O0, it will disable all optimizations. Now, as a separate issue, I take issue with the way the author of pineblaster thinks the compiler's optimizations work. "Non-deterministic" means that you can't be sure, from one run to the next, what path the code will take (or how long it will take), even given exactly the same inputs. Turning on optimizations does NOT create non-deterministic code. Even with full optimizations turned on (-O3), given the same inputs, the code will run exactly the same each time. What I think the author meant is that turning on optimizations will make following the assembly output very difficult for us poor humans, and that is it much harder to predict the exact timing of a particular section of code with optimizations turned on. *Brian

Yeah that makes sense. Thanks a lot for your help Brian!

Jack


majenko

Wed, 12 Aug 2015 15:03:47 +0000

You may also need to change how interrupts are handled since chipKIT has its own internal interrupt management system.

You can read more here: http://chipkit.net/interrupts-made-easy-with-chipkit/


JackZ

Wed, 12 Aug 2015 15:35:03 +0000

You may also need to change how interrupts are handled since chipKIT has its own internal interrupt management system. You can read more here: http://chipkit.net/interrupts-made-easy-with-chipkit/

The interruption is not a big problem for me though, since I am not really using that function.

Actually, the error message says that

“…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: function at exception vector 3 too large

…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: function at exception vector 24 too large

…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: Link terminated due to previous error(s).

collect2: ld returned 1 exit status”

I looked at the pic32-gcc.exe file. It turned out that there is something called pic32-gccbug file right below it. Do they relate to each other please?

Thanks, Jack


majenko

Wed, 12 Aug 2015 15:49:34 +0000

That error is caused by the fact that the interrupt routine hasn't been changed to do it the right way for the current system. You will need to read that link I posted and make the appropriate changes to the code to get it to compile.


JackZ

Wed, 12 Aug 2015 17:29:40 +0000

That error is caused by the fact that the interrupt routine hasn't been changed to do it the right way for the current system. You will need to read that link I posted and make the appropriate changes to the code to get it to compile.

Thank you so much Majenko! Actually I am not quite familiar with interrupt. I guess the error has something to do with the _OUTPUT_COMPARE_3_VECTOR and the _ADC1_DATA24_VECTOR, but am not sure.

Do you have some suggestions about how I should change it please? Or would you like to recommend me some basic tutorial about interrupts please?

Thanks, Jack


majenko

Wed, 12 Aug 2015 18:02:43 +0000

The link I posted above explains it all. Basically:

  1. You no longer need to specify the vector in the function
  2. You don't manipulate IFx and IEx registers directly
  3. You use the standard chipKIT functions to attach an interrupt routine to a vector
  4. You use the standard chipKIT functions to enable/disable the interrupts.

All those are described in the link I gave above.


JackZ

Wed, 12 Aug 2015 18:26:49 +0000

The link I posted above explains it all. Basically:

  1. You no longer need to specify the vector in the function
  2. You don't manipulate IFx and IEx registers directly
  3. You use the standard chipKIT functions to attach an interrupt routine to a vector
  4. You use the standard chipKIT functions to enable/disable the interrupts. All those are described in the link I gave above.

I see. I deleted everything related to interruption and cut the instruction list from 15000 positions down to 1500. Now the error message is gone.

The code still does not work though. When I type in "hello" in serial terminal and hit enter nothing happens, and the connection is tested to be OK. How do I write \r(carriage return) and \n(new line feed) in MPIDE please?

Thank you very much for your help!

Jack


majenko

Wed, 12 Aug 2015 19:48:45 +0000

Just select NL & CR from the dropdown box in the serial monitor.


JackZ

Wed, 12 Aug 2015 20:25:44 +0000

Just select NL & CR from the dropdown box in the serial monitor.

It's finally working now. Thank you so much!