Anda di halaman 1dari 4

Work Distributing

1. Background project:
Thanks for helping of Mr.Toan, we have understood generally Bootloader project.

Flow chart of Project


In general, project will have 2 modes: User application mode and Boot mode. We
can select mode by read level of Sw1.
If Sw1 is 1, then Boot mode is selected, in this mode, boot file will receive
S19 file through UART then write to expected address on Flash.

If Sw1 is 0, then User application mode is selected, we need to check at that


address has data (?), if data is already written (value at address !=
0xFFFFF..FF), then it will start to process (blink led for example).
We will create a project with the following modules:
1.1 User application:
Create a simple user application and encode to S19 file (Figure 1), note that
we can define which address of user code is saved on RAM of board
KL46Z (Figure 2).

Figure 1

Figure 2
1.2 UART module:
UART terminal will send file (s19 file), we need to create a small module
which send a text file then check at receiver by reading buffer.
1.3 Flash module (read and write to FLASH)
We will re-use the sample code, or modify, depend on our ability, to read or
write to an address. We can check the value at that address after writing by
read value of a pointer which point to that address:
Ex:
#define ADD_TO_READ 0xA010
uint_32 * p = NULL;
p = (uint_32 *) ADD_TO_READ; // point p to this
address
value = *p; // read value at that address

1.4 Jump SP to a defined address on Flash:


We need to check that SP jumps to expected address? We can read address
of SP and compare to expected address; if they are equal, then true else
false.
2. Future plan:
After successfully process in each module above, then we will combine to project
by writing a boot file (boot mode) which will contains both 3 modules (UART
interface, Flash write module, and jump SP to expected address). It will receive
S19 file through UART and write to Flash at expected address then jump SP to
this address.

Anda mungkin juga menyukai