#include <reprogrammation.h>
Go to the source code of this file.
Functions | |
int | check_online_code_version (void) |
For client device : ask online last code version and receive program informations if there is and an update online. | |
void | copy_interrupt_vector (void) |
copy interrupt vector into information memory | |
void | erase_interrupt_vector (void) |
function to erase interrupt vector memory segment | |
int | MAC_recept (char *data_buffer, UINT8 *type, UINT16 wait, UINT8 memorise_adress) |
int | MAC_send (char *data_buffer, UINT8 type, UINT8 broadcast) |
void | serveur_reprog (void) |
this function handle ppp RF protocol for upload software "over the air" | |
void | try_perform_update (void) |
reboot on bootloader to update exploitation software | |
void | write_interrupt_vector (UINT16 addr, UINT16 it) |
function to write on interrupt vector (for reprogrammation) | |
void | write_start_end_adress (void) |
function to write start/end adress/ code version to information memory | |
Variables | |
__root const UINT16 | adc12 = IT_ADC12 |
__root const UINT16 | comparatorA = IT_COMPA |
__root const UINT16 | dacdma = IT_DACDMA |
unsigned int | Deadline_order_reprog |
UINT16 | his_id |
static MESSAGE_HEADER * | mes = (MESSAGE_HEADER*) buffer_phy |
static char * | mpdu = (char*) buffer_phy + sizeof(MESSAGE_HEADER) |
__root const UINT16 | nmi = IT_NMI |
UINT16 | our_id |
__root const UINT16 | port1 = IT_PORT1 |
__root const UINT16 | port2 = IT_PORT2 |
MEMORY_INFO_STRUCT * | ptr_info_prog = (MEMORY_INFO_STRUCT*) 0x1000 |
char * | ptr_interrupt_vector = (char *) 0xFFE0 |
__root const UINT16 | reset = START_ADDR |
__root const UINT16 | timerA0 = IT_TIMERA0 |
__root const UINT16 | timerA1 = IT_TIMERA1 |
__root const UINT16 | timerB0 = IT_TIMERB0 |
__root const UINT16 | timerB1 = IT_TIMERB1 |
__root const UINT16 | usart0rx = IT_USART0RX |
__root const UINT16 | usart0tx = IT_USART0TX |
__root const UINT16 | usart1rx = IT_USART1RX |
__root const UINT16 | usart1tx = IT_USART1TX |
__root const UINT16 | wdt = IT_WDT |
Definition in file reprogrammation.c.
int check_online_code_version | ( | void | ) |
For client device : ask online last code version and receive program informations if there is and an update online.
1 : onchip version have to be update
Definition at line 355 of file reprogrammation.c.
References cc2420_change_channel(), SOFT_INFO::channel, CHANNEL_EXPLOITATION, CHANNEL_REPROG, controller_read_alarm_frame(), erase_info_memory(), flash_info_write(), MAC_recept(), MAC_send(), MEMORISE_ADRESS, NB_SOFT_REQ, SEND_BROADCAST, type, TYPE_PROGAM_INFO, TYPE_REQ_SOFT_VERS, MEMORY_INFO_STRUCT::version, SOFT_INFO::version, WAIT_ANSWER_CLIENT, and wakeup_cc2420().
Referenced by main().
void copy_interrupt_vector | ( | void | ) |
copy interrupt vector into information memory
Definition at line 233 of file reprogrammation.c.
References erase_info_memory(), flash_info_write(), and ptr_interrupt_vector.
Referenced by init().
void erase_interrupt_vector | ( | void | ) |
function to erase interrupt vector memory segment
Definition at line 98 of file reprogrammation.c.
References init_flash(), and stop_flash().
Referenced by main(), and try_perform_update().
Definition at line 143 of file reprogrammation.c.
References BROADCAST_ID, buffer_phy, MESSAGE_HEADER::dest_id, MESSAGE_HEADER::lenght, mpdu, RecepFrame(), MESSAGE_HEADER::source_id, and MESSAGE_HEADER::type.
Referenced by check_online_code_version(), main(), and serveur_reprog().
Definition at line 182 of file reprogrammation.c.
References BROADCAST_ID, buffer_phy, MESSAGE_HEADER::dest_id, MESSAGE_HEADER::lenght, mpdu, sendFrame(), MESSAGE_HEADER::source_id, MESSAGE_HEADER::type, TYPE_ACK, TYPE_DATA, TYPE_ORDER_REPROG, TYPE_PROGAM_INFO, TYPE_REQ_PCKT, and TYPE_REQ_SOFT_VERS.
Referenced by check_online_code_version(), main(), PT_THREAD(), and serveur_reprog().
void serveur_reprog | ( | void | ) |
this function handle ppp RF protocol for upload software "over the air"
Definition at line 267 of file reprogrammation.c.
References BROADCAST_ID, cc2420_change_channel(), cc2420_powerdown(), CHANNEL_EXPLOITATION, clockb(), DATA_PACKET::data, display_number(), DONT_MEMORISE_ADRESS, halWait(), DATA_PACKET::id, MAC_recept(), MAC_send(), MAX_HAL_WAIT, MAX_TICK, MAX_UINT16, SEND_UNICAST, serial_puts(), SIZE_DATA_BUFFER, SIZE_SOFT_BUFFER, type, TYPE_ACK, TYPE_DATA, TYPE_PROGAM_INFO, TYPE_REQ_PCKT, WAIT_ANSWER_SERVER, and wakeup_cc2420().
Referenced by PT_THREAD().
void try_perform_update | ( | void | ) |
reboot on bootloader to update exploitation software
Definition at line 247 of file reprogrammation.c.
References _DINT, BOOT_START_ADDR, BOOT_TIMER_IT_ADDR, erase_interrupt_vector(), and write_interrupt_vector().
Referenced by PT_THREAD().
function to write on interrupt vector (for reprogrammation)
[in] | addr | : begin adress of new program |
[in] | it | : id of interrupt vector adress to write |
PORT2_VECTOR 0xFFE2 Port 2
USART1TX_VECTOR 0xFFE4 USART 1 Transmit
USART1RX_VECTOR 0xFFE6 USART 1 Receive
PORT1_VECTOR 0xFFE8 Port 1
TIMERA1_VECTOR xFFEA Timer A CC1-2, TA
TIMERA0_VECTOR 0xFFEC Timer A CC0
ADC12_VECTOR 0xFFEE ADC
USART0TX_VECTOR 0xFFF0 USAT 0 Transmit
USART0RX_VECTOR 0xFFF2 USART 0 Receive
WDT_VECTOR 0xFFF4 Watchdog Timer
COMPARATORA_VECTOR 0xFFF6 Comparator A
TIMERB1_VECTOR 0xFFF8 Timer B CC1-6, TB
TIMERB0_VECTOR 0xFFFA Timer B CC0
NMI_VECTOR 0xFFFC Non-maskable
RESET_VECTOR 0xFFFE Reset [Highest Priority]
Definition at line 79 of file reprogrammation.c.
References init_flash(), and stop_flash().
Referenced by main(), and try_perform_update().
void write_start_end_adress | ( | void | ) |
function to write start/end adress/ code version to information memory
Definition at line 119 of file reprogrammation.c.
References CONST_ADDR, END_ADDR, MEMORY_INFO_STRUCT::end_addr, init_flash(), MEMORY_INFO_STRUCT::start_addr, stop_flash(), MEMORY_INFO_STRUCT::version, and VERSION_CODE.
Referenced by init().
Definition at line 39 of file reprogrammation.c.
__root const UINT16 comparatorA = IT_COMPA |
Definition at line 43 of file reprogrammation.c.
Definition at line 32 of file reprogrammation.c.
unsigned int Deadline_order_reprog |
MESSAGE_HEADER* mes = (MESSAGE_HEADER*) buffer_phy [static] |
Definition at line 22 of file reprogrammation.c.
char* mpdu = (char*) buffer_phy + sizeof(MESSAGE_HEADER) [static] |
Definition at line 23 of file reprogrammation.c.
Definition at line 46 of file reprogrammation.c.
Definition at line 36 of file reprogrammation.c.
Definition at line 33 of file reprogrammation.c.
MEMORY_INFO_STRUCT* ptr_info_prog = (MEMORY_INFO_STRUCT*) 0x1000 |
char* ptr_interrupt_vector = (char *) 0xFFE0 |
Definition at line 47 of file reprogrammation.c.
Definition at line 38 of file reprogrammation.c.
Definition at line 37 of file reprogrammation.c.
Definition at line 45 of file reprogrammation.c.
Definition at line 44 of file reprogrammation.c.
Definition at line 41 of file reprogrammation.c.
Definition at line 40 of file reprogrammation.c.
Definition at line 35 of file reprogrammation.c.
Definition at line 34 of file reprogrammation.c.
Definition at line 42 of file reprogrammation.c.