Porting into TriCore Environment

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
SUBBU3881
Posts: 17
Joined: Mon Dec 04, 2017 10:46 am

Re: Porting into TriCore Environment

Post by SUBBU3881 » Wed Jan 10, 2018 8:54 am

Thanks for the valuable response. but my query on "Is it necessary to replace UART ant GPIO specific code with TriCore controller for generic Micropython Interpreter.?". My aim is Porting MicroPython onto AUTOSAR environment but not need for booting the board with micropython.

Thanks and Regards,
Siva Prakash Reddy

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Porting into TriCore Environment

Post by dhylands » Wed Jan 10, 2018 4:49 pm

The answer to your question is the same as the answer to "Will the STM32 specific UART and GPIO code work on the TriCore controller?"

Pastor
Posts: 7
Joined: Thu Nov 02, 2017 10:16 am

Re: Porting into TriCore Environment

Post by Pastor » Tue Jan 16, 2018 8:26 am

In my opinion, the best way to port Micropython to your uC is firstly to build successfully the interpreter ( "py" folder ) with your compilation toolchain. Then, you need to enable and use the REPL (computer terminal) to debug Micropython. To use the REPL you must need UART uC driver (C driver).
Consider the minimal and the STM examples, they are very useful.

SUBBU3881
Posts: 17
Joined: Mon Dec 04, 2017 10:46 am

Re: Porting into TriCore Environment

Post by SUBBU3881 » Mon Jan 29, 2018 6:20 am

Thanks for the valuable response.

I tried to build source code on the directory "/minimal" and I commented STM related code in the source because I need for Just MicroPython Interpreter only. I am using Infineon's HighTec IDE to cross-build the source code. Now I am facing some issues :? mentioned below.

1. What about the .py files in "/py" directory.? provide some details.

2. Some header files are out-come of .py files in "/py" directory. How can I generate them.?

3. Are the .py files are needed to build on the source build of MicroPython or Needed to build separately.?


Please help in this regard.




Thanks and Regards,
Siva Prakash Reddy

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Porting into TriCore Environment

Post by dhylands » Tue Jan 30, 2018 6:19 pm

I'd recommend that you try building the minimal image under linux using gcc and add a V=1 to the make command line.

This should cause all of the commands executed during the build to be shown, including the ones that process the .py files.

I have no idea whether its possible or not to have the HighTec IDE do stuff other than invoke the compiler. You'll need to consult with somebody that knows more about the HighTec IDE.

There are numerous header files that are generated by the various .py files in the py directory and these header files are required in order to build micropython.

SUBBU3881
Posts: 17
Joined: Mon Dec 04, 2017 10:46 am

Re: Porting into TriCore Environment

Post by SUBBU3881 » Mon Feb 05, 2018 12:54 pm

As you said We can build it for Unix/Linux using make command and I tried Unix related stuff only for understanding the compilation flow. But, My requirement is to cross-build it to TriCore Architecture, so I choose HighTec IDE. This IDE is not building python scripts. I separately ran those scripts and I added .h files to the project. Still I am facing QSTR related macro issues.
Last edited by SUBBU3881 on Tue Feb 06, 2018 4:42 am, edited 1 time in total.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Porting into TriCore Environment

Post by dhylands » Mon Feb 05, 2018 4:55 pm

I was suggesting that you run the make in linux just to learn the commands that are used to invoke the python scripts etc. If your IDE can't handle running anything other than the C compiler, then you'll have to manually run the scripts to generate the appropriate code.

SUBBU3881
Posts: 17
Joined: Mon Dec 04, 2017 10:46 am

Re: Porting into TriCore Environment

Post by SUBBU3881 » Wed Feb 14, 2018 6:06 am

Thanks for the response.

I ran python scripts seperately in Linux and I attached them to my project. Now, the "genhdr/qstrdefs.generated.h" holds the following..

QDEF(MP_QSTR_NULL, (const byte*)"\x00\x00\x00" "")
QDEF(MP_QSTR_, (const byte*)"\x05\x15\x00" "")
QDEF(MP_QSTR__star_, (const byte*)"\x8f\xb5\x01" "*")
....
....

Now, I am failing at using this file. I am facing following error..
error: 'MP_QSTR_doc' undeclared (first use in this function)

Why such errors coming.? How to generate MP_QSTR_xxxxx macros.?

Please, help in this regard.

Thanks and Regards,
Siva Prakash Reddy

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Porting into TriCore Environment

Post by stijn » Wed Feb 14, 2018 10:34 am

When reporting errors it is helpful to post the complete error message. As well as other interesting information, like which command you used to generate the file.

If it only gives that error for certain MP_QSTR_xxx definitions and not all of them, it means the generation didn't use all needed files/options. MP_QSTR_doc is in objproperty.c, but it is compiled conditionally with #if MICROPY_PY_BUILTINS_PROPERTY. So, likely during your qstr generation MICROPY_PY_BUILTINS_PROPERTY was 0 when the preprocessor ran hence it's not in qstrdefs.generated.h.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Porting into TriCore Environment

Post by dhylands » Wed Feb 14, 2018 5:20 pm

The QSTR generation logic in the makefile isn't perfect, so whenever I run into QSTR related errors (some QSTR definition not existing), I normally do a clean and rebuild, which will regenerate all of the QSTRs.

Post Reply