Page 1 of 1

How to compile the Project in IAR studio for STM32F429

Posted: Fri Feb 26, 2016 10:34 am
by TAOOO
I would like to use the mPython in my project. I use STM32F429 and compiler IAR studio.
So, the question is: what is the way of porting the Project to another compiler?

Re: How to compile the Project in IAR studio for STM32F429

Posted: Fri Feb 26, 2016 4:42 pm
by dhylands
I guess you'd have to try it, see what doesn't work and report back?

I believe that most of the developers are using gcc, so it really depends on whether (or how many) gcc-isms have crept into the code.

Re: How to compile the Project in IAR studio for STM32F429

Posted: Wed May 10, 2017 11:54 am
by stefon86
Sorry for reviving this old thread. But did you get it done?

I have the same problem: I want to port MicroPython to the IAR C compiler. So I would appreciate if you can tell me if you was successful..

Re: How to compile the Project in IAR studio for STM32F429

Posted: Sat Jun 03, 2017 7:05 am
by fkeujjpdc
I have the same problem´╝îiar can use gcc as it's core compile.but it's difficult to gen qstr

Re: How to compile the Project in IAR studio for STM32F429

Posted: Thu Jul 20, 2017 8:07 am
by Tetraeder
I have the same problem with Greenhills compiler and the qstr gen.
Because the preprocessor output not match exactly to this lines: https://github.com/micropython/micropyt ... efs.py#L26.
I tried a little but no working solution, yet.
Maybe someone had the same problem and can help?

Maybe you can configure IAR to execute a post-exec/script at first. To execute the python scripts for the qstr gen.

Re: How to compile the Project in IAR studio for STM32F429

Posted: Wed Jan 31, 2018 5:39 pm
by BramPeeters
Hi,

Another revival of this old thread.
I (think I) worked around the problem mentioned above by first compiling for stm32f4 under normal linux and then copy the generated files.
Cheating i know but if the generated stuff does not change much it is "workable".
However that is not the end of the road to misery.

\examples\embedding\README.md naively/optimistically mentions:
a) You would need to use C99 standard (you're using this 15+ years old standard already, not a 25+ years old one, right?).

Well IAR is a C99 standard compiler, unfortunately GCC is not and working around the nonstandard used by micropython is proving to be 'quite' challenging.

So far I have encountered:

- usage in flexible array initialization
- usage of alloca
- the trick with the emitnative.c (still not sure how that compiles actually under GCC/makefiles, as the N_THUMB/... are just defined and are not given a value but in the C file there are tests like (MICROPY_EMIT_THUMB && N_THUMB) which needs them to be a value and not just as being defined)
- in nativeglue, a reference is taken from nlr_push and nlr_pop without a prototype being present for the functions ? Including the h file does not work because they are being defined there (under certain conditions) io of a prototype. Again one for the not sure how this can compile in the original code.
- vmentrytable.h: Getting desperate here:
static const void *const entry_table[256] = {
[0 ... 255] = &&entry_default,
[MP_BC_LOAD_CONST_FALSE] = &&entry_MP_BC_LOAD_CONST_FALSE,
[MP_BC_LOAD_CONST_NONE] = &&entry_MP_BC_LOAD_CONST_NONE,
[MP_BC_LOAD_CONST_TRUE] = &&entry_MP_BC_LOAD_CONST_TRUE,

( and probably some minor ones which i have already suppressed :) )

Regards
Bram