Cannot use FreeRTOS on iMX7 M4 core

I have an iMX7 setup using your easy install with “Toradex Embedded Linux Stable Releases, Linux LXDE Image”. Also have yocto/angstrom running in a 64-bit Virtual Box enviroment as per the tutorial.

There are 2 FreeRTOS tutorials:

  1. Using ARM DS-5 IDE with Cortex-M4 of a Colibri iMX7
  2. webinar “First steps with heterogeneous Multicore processing on the NXP i.MX7”, Raul Munoz, Toradex brasil, dated a few years ago.

The tutorials are roughly the same, but have problems :

I cloned my virtual box and tar’ed linaro gcc-arm-embedded 4.9-2015-Q3-20150921
Ran packages:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386, 

which had hundreds of package related errors.
Ultimately, ~/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc --version, errors that file cannot be found. Using uname, target is a 32-bit elf executable, but apparently the package errors make running the compiler impossible.

I originally cloned the angstrom compiler environment in Virtual Box that works for iMX6 and iMX7 A9/A7 core development.

The tutorials suggest using DS-5 would be easier, but is not longer available to new licensee’s. I setup the newer Arm Development Studio and pulled the GitHub - toradex/FreeRTOS-Colibri-iMX7: FreeRTOS for Colibri iMX7 repository. Toradex’s tutorial shows how easy it is to use the repository DS project, Hello_world, however, there are NO project files, just a place holder stating they CANNOT BE INCLUDED DUE TO Nxp licensing issues. No project files makes it a non-trivial task. Toradex - you need to fix this!

So, I downloaded Toradex’s pre-built FreeRTOS binaries, of which there are 2 or 3 versions, none of which really work. I loaded these at boot time and indications are the .elf is running on the M4, but I do not see the FreeRTOS banner as shown in the Brasilian app engineers webinar video. The loaded program seems to echo characters entered into the top DB9 RS232 terminal, but I cannot say it’s working. The tutorial also mentions potential collisions between A9 linux and FreeRTOS use of serial port, clocks and maybe SPI. Toradex - you need to fix this!

Where to go from here? Any tips on Linaro setup? Why can’t the angstrom toolchain used for A9 development also be used for M4, certainly would make development more uniform. What about Visual Studio Code? Toradex - you need to have fully up to date instructions and working examples! Does anyone know of other repositories that actually work?

Thanks,
Robert

Dear @bobpbbd104

It seems there are multiple issues. I try to give you an overall answer, but I would be glad if we could split the different topics into individual questions if they require deeper discussions.

x86 Compiler

I’m not sure why you added the i386 architecture - you might need this for PC applications, but anything related to Toradex products is Arm-based. Therefore you need to install the Arm toolchain, as described for example here:

Arm DS-5 / Arm Development Studio / VSCode

As you mentioned, Arm DS-5 is not available anymore, and was replaced by Arm Development Studio. For customers who are looking for a free development solution, we built up support for Visual Studio Code.

The DS-5 project files are available directly from NXP - you can download the FreeRTOS offering from NXP and merge the project files into the git you downloaded from us. We are working with NXP to get a clearance which would allow us to redistribute these files into our git repository, but so far we didn’t get this approval.

If you open a new post and tell me exactly which example you want to use, and which development environment, I can help you to set up the tools. Please understand that I’m not able to solve everything. As you mentioned, this is not a trivial task.

Regarding VSCode: Can you please explain which part of the instructions are missing? I focused pretty much on this during the past months and am very eager to learn what we can improve for a better customer experience.

Binaries

Just today I got the confirmation from another customer that the binaries are working fine. Maybe there’s something wrong with your setup? But the fact that the application is echoing characters is a pretty good indication that there’s nothing wrong with that M4 code.

Solving the potential conflict of parallel use of certain resources such as a serial port can only be done by you. There’s no way for Toradex to decide whether a customer wants to use for example UART_B from the M4 application or from Linux.

Angstrom Toolchain

Well, there are dozens of options for M4 development environments. We selected a few and try to keep the documentation in a shape which is useful to our customers. Developing on the target itself was clearly not on our priority list, and is for example not an option for all our Windows CE based customers.

I suggest you stick with one of the supported options. Of course you are free to go with yet another solution, but be aware this might put quite some work on you to get everything working.

Best Regards, Andy

x86 Issues:

I solved the compiler issues by upgrading to gcc-arm-none-eabi-9-2019-q4-major. It is correct to do the sudo apt-get stuff so the 32-bit compiler can run under 64-bit VirtualBox on a PC.

Perfect that you found a solution. Thanks for the feedback.

Best regards,
Jaski