0% found this document useful (0 votes)
27 views

Work Distributing: 1. Background Project

The document outlines a project to create a bootloader that can select between two modes - user application mode or boot mode - based on the level of Switch 1. In boot mode, an S19 file will be received via UART and written to a specific flash memory address. In user application mode, the project will start processing if data is already written to that address, otherwise it will blink an LED. The project will include modules for the user application, UART communication, reading from and writing to flash memory, and jumping the stack pointer to a defined address in flash. Ultimately the modules will be combined into a boot file that receives an S19 file via UART, writes it to flash memory, and jumps the stack pointer

Uploaded by

Don oan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Work Distributing: 1. Background Project

The document outlines a project to create a bootloader that can select between two modes - user application mode or boot mode - based on the level of Switch 1. In boot mode, an S19 file will be received via UART and written to a specific flash memory address. In user application mode, the project will start processing if data is already written to that address, otherwise it will blink an LED. The project will include modules for the user application, UART communication, reading from and writing to flash memory, and jumping the stack pointer to a defined address in flash. Ultimately the modules will be combined into a boot file that receives an S19 file via UART, writes it to flash memory, and jumps the stack pointer

Uploaded by

Don oan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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.

You might also like