How could allocate just Cortex-R5 for FreeRTOS?

I’d like to allocate Cortex-R5 for FreeRTOS.
Any documentation or tutorial. I couldnt find anything.

Do anyone know specific core allocation for any app?

Hi hamzaygrtcm

Please refer to [url]https://developer.nvidia.com/embedded/dlc/l4t_rt_aux_cpu_src[/url]

1 Like

hi kayccc

I did makefile

l4t_rt_aux_cpu_src/l4t-rt/rt-aux-cpu-demo

but I got following errors.

ERROR: variable not set or empty: FREERTOS_DIR
ERROR: variable not set or empty: FREERTOS_COMMON_DIR
ERROR: variable not set or empty: OUTDIR
ERROR: variable not set or empty: CROSS_COMPILE
Makefile:37: *** Environment sanity check failed.  Stop.

How could I fix? By the way ,thanks your answers.

Should I do this in this configuration settings? You mention about it
[url]https://developer.nvidia.com/embedded/dlc/NVIDIA_Jetson_Sensor_Processing_Engine_DevGuide[/url]

CC clk.c
/home/nvidia/Desktop/l4t-rt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc: 1: /home/nvidia/Desktop/l4t-rt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc: ELF: not found
/home/nvidia/Desktop/l4t-rt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc: 4: /home/nvidia/Desktop/l4t-rt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc: Syntax error: "(" unexpected
Makefile:296: recipe for target '/home/nvidia/Desktop/l4t-rt/out/t18x/OBJ/clk.o' failed
make: *** [/home/nvidia/Desktop/l4t-rt/out/t18x/OBJ/clk.o] Error 2

I did first configuration then the error is changed.

I solved problem. Could you say this question answer please?

1) If I do flash to my device how to control FreeRTOS and jetson tx2. Flashing means changing to pc OS?
2) When I write a code. I compiler in intel cpu then flashing to device everytime?
3) there is no Linux_for_Tegra/bootloader directory in my tx2 device ?

FYI, you won’t need anything in the host’s “Linux_for_Tegra/” unless you are flashing or using flash tools. Individual programs do not require flash, they are just file copies.

You cannot use an Intel format program on arm64/aarch64/ARMv8-a. Your Intel host will need the cross compiler and tools. There are various tutorials and sections in the Jetson documents regarding this, but the gist is that cross tools include a compiler which runs on Intel but produces 64-bit ARM output. This is all that is needed for kernel builds. When you get to user space applications, then you also need the cross linker and cross sysfs to link against. These are explained in various Jetson documents for customization. On Ubuntu there are 64-bit ARM packages you can simply install and you’ll have most of what you need.

There are times when user space applications (kernel drivers are not user space, most everything else is) need something extra to link against. If you have what you need on the Jetson to do native compile (cross tools imply a foreign architecture), then a clone typically provides any files you need for cross compile (in user space most programs must link against libraries…the host needs those libraries to know how to link…you can easily do this natively on the Jetson itself, and if the Jetson is set up for development, then the clone can provide those libraries instead of trying to find the libraries on the internet and adding them). For TX2 clone information see:
[url]https://devtalk.nvidia.com/default/topic/1000105/jetson-tx2/tx2-cloning/[/url]
(instructions differ somewhat depending on release used)

I’ll suggest you initially set up the Jetson itself for native compile instead of cross compiling on the host. If this isn’t adequate, that’s when you can know it is time for cross compiling.

Thanks for answer.

I compiled my intel PC. How to flash in jetson tx2? I could’t find

Linux_for_Tegra/bootloader/

in local PC or jetson tx2. If I wrote code. Should I compile in Intel cpu evertime ?
and This works without ubuntu ?

I mentioned about :

https://developer.nvidia.com/embedded/dlc/l4t_rt_aux_cpu_src

doc/compile-flash.md

# FLASH

1. Back up the original copies of `spe.bin` and `spe_t194.bin` located in the
following directory:

    Linux_for_Tegra/bootloader/


2. Copy the generated `${OUTDIR}/spe.bin` to the following locating, depending on your target.
   - For Jetson TX2, copy it to:

         Linux_for_Tegra/bootloader/spe.bin
   - For the Jetson AGX target, copy it to:

         Linux_for_Tegra/bootloader/spe_t194.bin

   The `Linux_for_Tegra` directory is part of the extracted L4T build that
   you used to flash the Jetson device.
3. Use the command below to just flash this firmware for Cortex-R5 partition:

       sudo ./flash.sh -k spe-fw jetson-<tx2 or xavier> mmcblk0p1

I don’t know specifically about your modifications for FreeRTOS, I can only comment on the flashing process. Someone who has added FreeRTOS to this specific L4T release (found by “head -n 1 /etc/nv_tegra_release”) would probably be able to provide more help.

Can you be more specific about what you actually want to install (specifics, not just “FreeRTOS”)? For example, the root filesystem? Or modifications to the root filesystem? Maybe add programs, but leave the actual basic operating system in place? Or perhaps kernel modules/drivers?

If you’ve built a kernel Image file, then it is just a file copy, e.g., backup the original, and copy to the TX2 (there is more to it if you end up unbootable, e.g., sometimes it is best to add a renamed Image and make an alternate boot entry for serial console select…but all of those details depend on which release you use…see “head -n 1 /etc/nv_tegra_release” on the running Jetson).

Note that some of the flash.sh options might not be quite what you expect, e.g., something with kernel in the name might actually be the kernel bootloader and not the kernel. You’d need to consult the docs for that specific release.

Hello linuxdev,

spe-fw has been updated successfully. But I dont ever debugging any IDE or executable file? Accually, I want to see output for my code.
You know. For debugging you are writing printf or etc. in order to see output…
How could I do that ?

It really depends on what you are debugging. Are you debugging user space programs? Kernel drivers? The former is easy, the latter is best with printk statements. Much more information is needed on what you are debugging.

Regarding debugging of user apps, I literally tend to just add “cgdb” onto the Jetson (an ncurses front end to gdb) and debug that way. gdb by itself is fine as well, or any other gdb front end, but I like the cgdb front end.

Debugging a kernel can be done with kgdboc and kgdb, but it is a steep learning curve and there are lots of “gotchas” along the way, e.g., watchdog timers.

A hardware JTAG debugger is only in theory a better route, but getting something compatible with the Jetsons and actually supported by the JTAG debugger provider is scarce and very expensive. If you have thousands of dollars (or even tens of thousands of dollars) to spend, and need some serious debugging power in the kernel, then this might be the way to go.