remote programming system for µ-sat3’s...remote programming system for µ-sat3’s on-board...

18
Remote programming system for μ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de Investigaciones Aplicadas (CIA - DGIyD) Facultad de Ciencias Exactas, Físicas y Naturales Universidad Nacional de Córdoba (FCEFyN - UNC)

Upload: others

Post on 14-Mar-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Remote programming system for µ-SAT3’s On-Board Computer

Authors: Nazzi, Fabio

Rodriguez Gonzalez, Santiago Morales, Pablo

Centro de Investigaciones Aplicadas (CIA - DGIyD)

Facultad de Ciencias Exactas, Físicas y Naturales

Universidad Nacional de Córdoba (FCEFyN - UNC)

Page 2: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Contents

Importance of having a remote programming system

Introduction Environment Overview of the system

Development details System structure Firmware JTAG-based programmer

Conclusions and future work

Page 3: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Why a remote programmer for this project?

Fixing software bugs,

Improvements for current program,

Changes in project requirements,

Facing other unforeseen events.

Implemented solution

JTAG-based programmer

Page 4: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Environment

µSAT-3 will have two independent On-Board Computers (OBC).

They will be capable of receiving new

software through an UHF link.

Hardware

TMS570LS3137 ARM Cortex-R4F core, IEEE1149.1 standard compliant.

Flash memory

Compatible with SPI protocol.

Page 5: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

OBCs’ connection for this system

GP

IOJT

AG

GP

IOJT

AG

Active connection

Inactive connection

TMS570

Ext.flash

Active OBC Backup OBC

TMS570

Ext.flash

At a given moment will be an active OBC, and the other will function as a backup.

The communication between TMS570 microcontroller and external flash SPI protocol.

A GPIO port of active OBC must be connected to JTAG port of backup OBC bitbanging technique.

Page 6: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Source: SPNA230 Texas Instruments

Hercules JTAG scan architecture

ICEPick TAP Texas Instruments

design

DAP TAP

Implements ADI v5.1

Page 7: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

System description

First part:

Receive a software divided into fixed-length packets.

Check the packets for errors. Every packet must include an error detecting code.

Store each correctly received packet into the external flash memory.

Implement an error control scheme.

Second part:

It is responsible for backup OBC programming, emulating JTAG signals through a GPIO port.

WE WILL EMPHASIZE MAINLY THIS POINT

Page 8: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

OBC programming

It involves two parts:

A piece of software that manages the operations over on-chip flash Firmware. This is necessary due to it is not possible

to write directly into program memory.

A software that controls the low level JTAG operations JTAG-based programmer. It generates JTAG signals over a GPIO

port. It has full control over firmware

execution.

Page 9: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Firmware [1/3]

Two independent functions over on-chip flash memory: Erase, Program.

Written in C, using F021 Flash API.

Compiled and linked for a freestanding environment. Do not exist a defined entry point for the

firmware.

It will be executed from backup OBC SRAM memory.

The active OBC will have control of the execution of each firmware routine.

Page 10: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Firmware [2/3]

Start

Call

Fapi_inita ilizeFlashBanks()

Call

Fapi_setActiveFlashBank()

for curren t bank

Call

Fapi_enableMainBankS ectors()

for curren t bank

FAPI_CHECK_FSM_READY_BUSY

!= Fapi_Status_FsmReady

No

Call

Fapi_issueAsyncCommandWithAddress()

with Fapi_EraseBank command

FAPI_CHECK_FSM_READY_BUSY

!= Fapi_Status_FsmReady

FAPI_GET_FSM_STATUS != 0 Erasing failedYes

Another bank to erase?No

Erasing successful

Yes

Yes

Yes

No

No

erase_flash() routine.

This function clears all sectors of each flash memory bank.

Simplified diagram

Page 11: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Firmware [3/3]

Start

Call

Fapi_inita ilizeFlashBanks()

Call

Fapi_setActiveFlashBank()

for curren t bank

Call

Fapi_enableMainBankS ectors()

for curren t bank

FAPI_CHECK_FSM_READY_BUSY

!= Fapi_Status_FsmReady

No

Call

Fapi_issueProgrammingCommand()

with Fapi_DataOnly option

FAPI_CHECK_FSM_READY_BUSY

!= Fapi_Status_FsmReady

More data to program?No Programming

successful

Yes

Yes

FAPI_GET_FSM_STATUS !=

Fapi_Status_SuccessProgramming failed

Yes

No

Yes

No

program_flash() routine.

It performs flash writes. Programming

mode selected, Fapi_DataOnly.

Simplified diagram

Page 12: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

JTAG-based programmer [1/5]

Start

JTAG in terface initializat ion

and

Microcontrolle r configuration

Load firmware in to RAM

Call

erase_flash()

routine

Successful

erasing?

NoExit

Yes

Load a piece of so ftware

into RAM

Call

program_flash()

routine

Successful

writing?

Yes

More data to

program?

No Programming

successful

NoExit

Yes

Page 13: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

JTAG-based programmer [2/5]

It provides access to system resources via JTAG port.

It has to gain access to the JTAG interface, sending proper commands to the ICEPick module.

ICEPick allows enabling the DAP TAP, writing the corresponding TAP configuration register.

At this point, JTAG scan path consists of:

ICEPick TAP DAP TAP

Page 14: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

JTAG-based programmer [3/5]

Source: SPNA230 Texas Instruments

TAP controllers must be synchronized.

It is possible to access: ARM core registers; System and peripheral registers

of the microcontroller; Execute most ARM instructions; Operate directly over almost

every peripheral.

Page 15: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

JTAG-based programmer [4/5]

Through DAP TAP: Halt the processor. Configure breakpoint at address 0x0. Reset.

Load firmware onto on-chip SRAM via AHB-AP.

Control for firmware routines execution:

Entry point Program Counter. Return point Link Register.

Poll breakpoint control register.

Returned value must be checked at R0 ARM

core register.

Page 16: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

JTAG-based programmer [5/5]

Order of execution:

erase_flash() To clear all flash banks. IT MUST BE EXECUTED BEFORE WRITING ANY

DATA.

program_flash() load pieces of new software onto SRAM due to SRAM < Flash. It writes pieces of new software from SRAM to on-chip flash.

If an error occurs after a function execution system exit. The new program is ready to be executed!

Page 17: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Conclusions

This system was successfully implemented.

As it was constructed, it will function over an Operating System with minimal changes.

Is it possible to reutilize a lot of this system in another platform compatible with IEEE 1149.1 standard.

Future work

Implement a hash function in order to protect the new software stored in external flash memory.

Improve the error control scheme implemented.

Improve JTAG-based programmer code to get lower delay signals.

Page 18: Remote programming system for µ-SAT3’s...Remote programming system for µ-SAT3’s On-Board Computer Authors: Nazzi, Fabio Rodriguez Gonzalez, Santiago Morales, Pablo Centro de

Nazzi, Fabio

[email protected]

Thank you!