Porting into TriCore Environment
Re: Porting into TriCore Environment
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
Thanks and Regards,
Siva Prakash Reddy
Re: Porting into TriCore Environment
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?"
Re: Porting into TriCore Environment
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.
Consider the minimal and the STM examples, they are very useful.
Re: Porting into TriCore Environment
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
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
Re: Porting into TriCore Environment
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.
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.
Re: Porting into TriCore Environment
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.
Re: Porting into TriCore Environment
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.
Re: Porting into TriCore Environment
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
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
Re: Porting into TriCore Environment
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.
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.
Re: Porting into TriCore Environment
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.