OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [docs/] [userguide/] [executable_upload.adoc] - Blame information for rev 69

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 69 zero_gravi
<<<
2
:sectnums:
3
== Uploading and Starting of a Binary Executable Image via UART
4
 
5
Follow this guide to use the bootloader to upload an executable via UART.
6
 
7
[NOTE]
8
This concept uses the default "Indirect Boot" scenario that uses the bootloader to upload new executables.
9
See datasheet section https://stnolting.github.io/neorv32/#_indirect_boot[Indirect Boot] for more information.
10
 
11
[IMPORTANT]
12
If your FPGA board does not provide such an interface - don't worry!
13
Section <<_installing_an_executable_directly_into_memory>> shows how to
14
run custom programs on your FPGA setup without having a UART.
15
 
16
[start=1]
17
. Connect the primary UART (UART0) interface of your FPGA board to a serial port of your host computer.
18
. Start a terminal program. In this tutorial, I am using TeraTerm for Windows. You can download it for free
19
from https://ttssh2.osdn.jp/index.html.en . On Linux you could use GTKTerm, which you can get here
20
https://github.com/Jeija/gtkterm.git (or install via your package manager).
21
 
22
 
23
[NOTE]
24
_Any_ terminal program that can connect to a serial port should work. However, make sure the program
25
can transfer data in _raw_ byte mode without any protocol overhead around it.
26
 
27
[start=3]
28
. Open a connection to the the serial port your UART is connected to. Configure the terminal setting according to the
29
following parameters:
30
 
31
* 19200 Baud
32
* 8 data bits
33
* 1 stop bit
34
* no parity bits
35
* _no_ transmission/flow control protocol
36
* receiver (host computer) newline on `\r\n` (carriage return & newline)
37
 
38
[start=4]
39
. Also make sure that single chars are send from your computer _without_ any consecutive "new line" or "carriage
40
return" commands (this is highly dependent on your terminal application of choice, TeraTerm only
41
sends the raw chars by default).
42
. Press the NEORV32 reset button to restart the bootloader. The status LED starts blinking and the
43
bootloader intro screen appears in your console. Hurry up and press any key (hit space!) to abort the
44
automatic boot sequence and to start the actual bootloader user interface console.
45
 
46
.Bootloader console; aborted auto-boot sequence
47
[source,bash]
48
----
49
<< NEORV32 Bootloader >>
50
 
51
BLDV: Mar 23 2021
52
HWV:  0x01050208
53
CLK:  0x05F5E100
54
MISA: 0x40901105
55
ZEXT: 0x00000023
56
PROC: 0x0EFF0037
57
IMEM: 0x00004000 bytes @ 0x00000000
58
DMEM: 0x00002000 bytes @ 0x80000000
59
 
60
Autoboot in 8s. Press key to abort.
61
Aborted.
62
 
63
Available commands:
64
h: Help
65
r: Restart
66
u: Upload
67
s: Store to flash
68
l: Load from flash
69
e: Execute
70
CMD:>
71
----
72
 
73
[start=6]
74
. Execute the "Upload" command by typing `u`. Now the bootloader is waiting for a binary executable to be send.
75
 
76
[source,bash]
77
----
78
CMD:> u
79
Awaiting neorv32_exe.bin...
80
----
81
 
82
[start=7]
83
. Use the "send file" option of your terminal program to send a NEORV32 executable (`neorv32_exe.bin`).
84
. Again, make sure to transmit the executable in raw binary mode (no transfer protocol).
85
When using TeraTerm, select the "binary" option in the send file dialog.
86
. If everything went fine, OK will appear in your terminal:
87
 
88
[source,bash]
89
----
90
CMD:> u
91
Awaiting neorv32_exe.bin... OK
92
----
93
 
94
[start=10]
95
. The executable is now in the instruction memory of the processor. To execute the program right
96
now run the "Execute" command by typing `e`:
97
 
98
[source,bash]
99
----
100
CMD:> u
101
Awaiting neorv32_exe.bin... OK
102
CMD:> e
103
Booting...
104
Blinking LED demo program
105
----
106
 
107
[start=11]
108
. If everything went fine, you should see the LEDs blinking.
109
 
110
[NOTE]
111
The bootloader will print error codes if something went wrong.
112
See section https://stnolting.github.io/neorv32/#_bootloader[Bootloader] of the NEORV32 datasheet for more information.
113
 
114
[TIP]
115
See section <<_programming_an_external_spi_flash_via_the_bootloader>> to learn how to use an external SPI
116
flash for nonvolatile program storage.
117
 
118
[TIP]
119
Executables can also be uploaded via the **on-chip debugger**.
120
See section <<_debugging_with_gdb>> for more information.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.