Open main menu

DAVE Developer's Wiki β

Changes

BELK-TN-007: FreeRTOS on single-core Bora Lite SoM

3,491 bytes added, 08:42, 28 October 2021
no edit summary
{{InfoBoxTop}}
{{Applies To Bora}}
{{Applies To BoraX}}
{{Applies To BoraLite}}
{{AppliesToBORA Lite TN}}
{{InfoBoxBottom}}
__FORCETOC__
== Introduction ==
In general, Bora Lite SoM is suited for compact, cost-sensitive applications for which [[:Category:Bora|Bora]] or [[:Category:BoraX|BoraX]] would be overkilling. In this scenario, Bora Lite is often equipped with XC7Z007 or XC7Z014 SoC's, which implement single-core processors. In combination with FreeRTOS, such configurations can be the right solution to address applications with real-time constraints as wellapplications not requiring the rich set of features provided by GNU/Linux operating system. This Technical Note (TN) shows describes how to use run a FreeRTOS on Hello, world!-type application a single-core Bora Lite model. TBD
==Testbed==
From the hardware perspective, the testbed is like the one shown [[BELK/BXELK_Quick_Start_Guide#BoraX-BoraXEVB-Lite|here]]. It consists of a BoraXEVB carrier board, a Bora Lite Adapter, and a single-core Bora Lite SoM(equipped with XC7Z007 SoC).
The BoraXEVB carrier board is set up to make the SoM boot from the microSD card.
==Running the application==
There are several ways to run the application on the target. For instance, a JTAG debugging tool can be used. The following is a script in PRACTICE language used to set up a debugging session with [https://www.lauterbach.com/ Lauterbach TRACE32 PowerView]:
<pre>
SYStem.CPU ZYNQ-7000CORE0
; This selects the DAP for accessing the ARM cores
; (accessing the TAP of the FPGA logic requires different settings)
SYStem.CONFIG DAPIRPRE 6.
SYStem.CONFIG DAPIRPOST 0.
SYStem.CONFIG DAPDRPRE 1.
SYStem.CONFIG DAPDRPOST 0.
TRONCHIP.SET UNDEF OFF
TRONCHIP.SET DABORT OFF
TRONCHIP.SET PABORT OFF
SYStem.Option DACR ON
SYStem.OPTION MMU ON
SYStem.OPTION MMUSPACES OFF ; linux is not started yet!
;enddo
; run bootrom and FSBL to init the whole system
;SYStem.UP
; go is disabled because reset is not connected and UP act like a attach
;go
system.mode attach
 
break
break.delete /all
TASK.CONFIG ~~/demo/arm/kernel/freertos/freertos.t32 ; load FreeRTOS awareness
MENU.ReProgram ~~/demo/arm/kernel/freertos/freertos.men ; load FreeRTOS menu
 
data.load.elf r:\home\dvdk\devel\boralite\workspace-2019.1\freertos_hello_world\Debug\freertos_hello_world.elf
 
b.s main
go
enddo
 
</pre>
 
 
Please note that the FreeRTOS console is routed to the same UART used for the U-Boot console:
[[File:BoraLite-FreeRTOS9.png|thumb|center|800px|Debugging session with Lauterbach TRACE32 PowerView]]
 
 
Another way to download and run the application is by using the <code>tftpboot</code> and <code>bootelf</code> commands as shown in the following example (*):
<pre class="board-terminal">
Bora> tftpboot ${loadaddr} boralite/freertos_hello_world.elf
Using ethernet@e000b000 device
TFTP from server 192.168.0.13; our IP address is 192.168.0.81
Filename 'boralite/freertos_hello_world.elf'.
Load address: 0x2080000
Loading: #################################################################
#########################
1.4 MiB/s
done
Bytes transferred = 457608 (6fb88 hex)
Bora> bootelf 0x2080000
CACHE: Misaligned operation at range [00100000, 0010e78c]
CACHE: Misaligned operation at range [0010e78c, 0010e798]
CACHE: Misaligned operation at range [0010e798, 0010e7a4]
CACHE: Misaligned operation at range [0010e7a8, 0010ef84]
CACHE: Misaligned operation at range [0010ef88, 0010fcbc]
CACHE: Misaligned operation at range [0010fcbc, 0010fcc0]
CACHE: Misaligned operation at range [00114000, 00114008]
CACHE: Misaligned operation at range [00114008, 0011400c]
CACHE: Misaligned operation at range [0011400c, 00114010]
CACHE: Misaligned operation at range [00114010, 00124554]
CACHE: Misaligned operation at range [00124554, 00126560]
CACHE: Misaligned operation at range [00126560, 00129d60]
## Starting application at 0x00100000 ...
Hello from Freertos example main
Rx task received string from Tx task: Hello World
Rx task received string from Tx task: Hello World
Rx task received string from Tx task: Hello World
Rx task received string from Tx task: Hello World
Rx task received string from Tx task: Hello World
Rx task received string from Tx task: Hello World
FreeRTOS Hello World Example PASSED
</pre>
 
 
(*) It seems that the message ''CACHE: Misaligned operation at range [x, y]'' is [https://forums.xilinx.com/t5/Embedded-Linux/CACHE-Misaligned-operation-at-range-1ffed120-1ffed276/td-p/963278 not a real problem].
 
==Related links==
*
 
* [[BELK-AN-001: Asymmetric Multiprocessing (AMP) on Bora – Linux FreeRTOS]]
* [[BELK-AN-002: Trace on the Bora AMP (Linux + FreeRTOS) system]]
* [[BELK-AN-007: Asymmetric Multiprocessing (AMP) on Bora/BoraX with OpenAMP]]
8,226
edits