-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef2ed8b
commit 4df56ed
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[> Bare Metal Demo App | ||
---------------------- | ||
|
||
This directory provides a minimal bare metal demo app that demonstrates how to easily create a bare metal C application and load it/run it on the CPU of a SoC. | ||
|
||
[> Build | ||
-------- | ||
|
||
Imagine you just build Arty example design from LiteX-Boards, to build the demo app, run in this directory: | ||
`$ export BUILD_DIR=xxyy/litex/litex/boards/targets/build/arty && make` | ||
|
||
[> Load | ||
------- | ||
|
||
Loading the compiled demo app can be done in different ways as explain in LiteX's wiki: | ||
https://github.com/enjoy-digital/litex/wiki/Load-Application-Code-To-CPU | ||
|
||
Since our app is small and for simplicity we'll just load it over serial here: | ||
`$ lxterm /dev/ttyUSBX --kernel=demo.bin` | ||
|
||
You should see the minimal demo app running and should be able to interact with it: | ||
|
||
--============== Boot ==================-- | ||
Booting from serial... | ||
Press Q or ESC to abort boot completely. | ||
sL5DdSMmkekro | ||
[LXTERM] Received firmware download request from the device. | ||
[LXTERM] Uploading demo.bin to 0x40000000 (9264 bytes)... | ||
[LXTERM] Upload complete (9.8KB/s). | ||
[LXTERM] Booting the device. | ||
[LXTERM] Done. | ||
Executing booted program at 0x40000000 | ||
|
||
--============= Liftoff! ===============-- | ||
|
||
LiteX minimal demo app built Dec 10 2020 17:13:02 | ||
|
||
Available commands: | ||
help - Show this command | ||
reboot - Reboot CPU | ||
led - Led demo | ||
donut - Spinning Donut demo | ||
litex-demo-app> led | ||
Led demo... | ||
Counter mode... | ||
Shift mode... | ||
Dance mode... | ||
litex-demo-app> donut | ||
Donut demo... | ||
|
||
$$$$$@@@@@ | ||
$##########$$$$$$$$ | ||
###*!!!!!!!!!***##$$$$$$ | ||
***!!====;;;;===!!**###$$$$# | ||
**!===;;;:::::;:===!!**####$## | ||
!*!!==;;:~-,,.,-~::;;=!!**#######! | ||
!!!!=;:~-,.......-~::==!!***#####* | ||
!!!!==;~~-.........,-:;==!!***###**! | ||
!**!!=;:~-... ..-:;=!!!********! | ||
;!*#####*!!;. ~:;==!!!******!!= | ||
:!*###$$$$#*! :;==!!!!!****!!!=; | ||
~=!*#$$$@@@$$##!!!!!!!!!!!!****!!!!=; | ||
;=!*#$$$@@@@$$#*******!*!!*!!!!!==;~ | ||
-;!*###$$$$$$$###******!!!!!!!===;~ | ||
-;!!*####$#####******!!!!!!==;;:- | ||
,:=!!!!**#**#***!!!!!!!====;:~, | ||
-:==!!!*!!*!!!!!!!===;;;:~- | ||
.~:;;========;=;;:::~-, | ||
.--~~::::~:~~--,. | ||
litex-demo-app> | ||
|
||
[> Going further | ||
---------------- | ||
To create more complex apps, feel free to explore the source code of the BIOS or other open source projects build with LiteX at https://github.com/enjoy-digital/litex/wiki/Projects. |