Home
Application Note
Contents
1. eens 6 DEVELOPMENT ENVIRONMENT 1 7 4 ee ee eee 8 5 BOOTLOADER OPERA TIONS eee cee 9 Sd PIRE RR DEN DUM 9 52 Roo c 9 5 3 Memory que salen IN Sun CI RR 11 5 4 Jump into user appliCallOhi usi tutis oai thus sud deti d c 13 5 5 Edu 14 5 5 1 Bootloader linker 0 0 14 5 5 2 User application code linker settings 14 5 6 User application code version number settings 15 6 QUICK START USING FSSDC 9B618 EVB 1 0 16 6 1 Download Bootloader to Flash nr etre kt ica teta cra a oiu Pn Rn cR 16 6 1 1 Settings for USB On Board 16 6 2 Configure User Application Code 18 6 3 Download User Code to 18 6 3 1 Enter Ethernet bootloader mode
2. Advanced Not supported by most TFTP Servers RFC 1783 Blocksize Negotiatior 512 Blocksize RFC 1784 Timeout Negotiatior 10 Seconds RFC 1784 Transfer size Negotiatior Stop Progress Received error from peer user code area erased Once you have completed the form Click the GO Figure 19 erase user code area After user code area erased 3CDaemon will display Progress Received error from peer user code area erased Notes This command will erase all flash sectors of user applications after 0x00020000 7 Bootloader API functions Refer to Appendix B for more details 1 Bootloader module uint16 t Bootloader ReadFlashSecurityBit void void Bootloader JumpBoot uint32 t u32Address void Bootloader ExecuteUserApplication void boolean t Bootloader_UserCodeValid void boolean t Bootloader CheckEmpty void void Bootloader EraseChip void void Bootloader ExecuteSoftwareReset void en run mode t Bootloader JudgeRunMode void static void ConfigureEthernetPins void int32 t Bootloader EthernetlAPInit void static void LED Init void 2 Flash module 1132 t FlashRomEraseSector uint32 t u32SectorEraseAddress 1132 1 FlashDataPolling uint32 t u32PollAddress uint16 t u16PollData 1132 t FlashRomProgram uint32 t u32ProgramAddress uint16 t u16ProgamData 4 Tftp server module MCU AN 510047 E 10 Page 22 co FUJITSU Chapter 7 Bootloader API functions u
3. Complete form and click here to begin transfer Local FileName 5 Blink bin Advanced Not supported by most TFTP Servers Nera Octet Binary Mode gt STOR v 1783 Blocksize Negotiatior Click here to stop a transfer in progress Blocksize 512 RFC 1784 Timeout Negotiatior Seconds 10 Go Click here to send multiple files RFC 1784 Transfer size Negotiatior Stop Progress Click here to send an entire directory Once you have completed the form Click the GO Figure 15 TFTP client settings 1 Set to TFTP client mode 2 Set TFTP Server Address to 192 168 1 20 3 Set Operation mode gt Write flash choose Send file gt Read flash choose Receive file 4 Set Transfer Mode to Octet Binary Mode 5 Fill Remote File Name with version information gt Version Format Vx x example V1 0 V1 1 V2 0 V2 3 Please control the version number and format as the examples Set Local File to the target test code routine and select the Test_LED bin file Select RFC 1783 Blocksize Negotiation Select REC 1784 Timeout Negotiation and set seconds to 10 Select REC 1784 Transfer size Negotiation ON 6 3 3 Flash Empty To describe execute steps clear several operations will be shown below Before running customer must confirm user application code project s linker settings and version numb
4. PERFORM The following document contains information on Cypress products Although the document is marked with the name Spansion and Fujitsu the company that originally developed the specification Cypress will continue to offer these products to new and existing customers Continuity of Specifications There is no change to this document as a result of offering the device as a Cypress product Any changes that have been made are the result of normal document improvements and are noted in the document history page where supported Future revisions will occur when appropriate and changes will be noted in a document history page Continuity of Ordering Part Numbers Cypress continues to support existing part numbers To order these products please use only the Ordering Part Numbers listed in this document For More Information Please contact your local sales office for additional information about Cypress products and solutions About Cypress Cypress NASDAQ CY delivers high performance high quality solutions at the heart of today s most advanced embedded systems from automotive industrial and networking platforms to highly interactive consumer and mobile devices With a broad differentiated product portfolio that includes NOR flash memories F RAM and SRAM Traveo microcontrollers the industry s only PSoC programmable system on chip solutions analog and PMIC Power Management ICs CapSense capacitive touch sen
5. ARP IP UDP provided by LwIP1 4 0 Supports Ethernet MAC driver provided by mb9bf61xt ethernet lwip library the update can be found from http mcu emea fujitsu com mcu product mcu all software htm Supports static IP address assignment Optional flash security function Supports configuration of user code area LAN z Ethernet cable MB9BF618 ma E Ethernet cablg MB9BF618 Host EVB Figure 1 Interconnections 1 2 Reference Documents 1 MB9Bxxx MN706 00002 4v0 E pdf 2 MB9BF210T_610T MN706 00015 1v0 E pdf 3 Design and Implementation of the LWIP TCP IP Stack Feb 2001 Adam Dunkels 4 MB9Bx10T MN706 0001 4 1v0 E pdf 5 MCU AN 300411 E V10 fm3 usb host masstorage bootloader pdf 6 SS MB9B618S EV Board User Manual pdf MCU AN 510047 E 10 Page 5 co FUJITSU Chapter 2 Hardware Environment 2 Hardware Environment Hardware board FSSDC 9B618 EVB v1 0 USB JTAG device USB host Ethernet Part 1 Serial Port Ethernet 0 Test Pin Reset External 15V DC Micro SD Joystick LED Nand bo Flash Selection Figure 2 FSSDC 9B618 EVB v1 0 MCU Fujitsu MB9BF618S e MCU Frequency 144MHz e Ram Space 128 K bytes e Code Space 1 M bytes MCU AN 510047 E 10 Page 6 co FUJITSU Chapter 3 Development Environment 3 Development Environment Name Description Part Number Manufacturer Remark Software IAR EWARM Developing IDE V6 50 IAR J link MCU Em
6. Describe This function will judge user code area And return memory statement Note MCU AN 510047 E 10 Page 26 co FUJITSU Appendix API List Bootloader EraseChip Erase user code area flash memory Prototype void Bootloader EraseChip void Parameter None Return None Describe This function will erase user code area directly Note Bootloader ExecuteSoftwareReset Software reset the code Prototype void Bootloader ExecuteSoftwareReset void Parameter None Return None Describe Software reset the code Note Bootloader JudgeRunMode Judge which mode to run Prototype en run mode t Bootloader JudgeRunMode void Parameter None Return en run mode t MCU AN 510047 E 10 Page 27 co FUJITSU Appendix B API List USER MODE BOOTLOADER MODE Describe Judge which mode to run If return BOOTLOADER MODE the program will run bootloader code else run the user application code Note Bootloader ConfigureEthernetPins Configure general ports for Ethernet pins Prototype void Bootloader ConfigureEthernetPins void Parameter None Return None Describe Configure the ports for Ethernet Note Bootloader EthernetlAPInit Initial Ethernet IAP function Prototype int32 t Bootloader_EthernetlAPInit void Parameter None Return int32 t Describe Initial Ethernet IAP Note LED Init Initial IO ports for LED control Prototyp
7. K K K K K K K K K K OK OK OK K OK OK K K OK K K K OK K K OK OK OK K OK OK K K K OK K K OK K OK OK KOK EEE ALE ifdef ICCARM void BootloaderAPI JumpBoot uint32 t u32Address asm LDR SP R Load new stack pointer address asm LDR PC R 4 Load new program counter address elif ARM asm void BootloaderAPI JumpBoot uint32 t u32Address LDR SP R Load new stack pointer address LDR PC RO 4 Load new program counter address else error PK 2K 2K 2K K K OK K K OK K K K OK K K OK K K OK OK K K K OK OK K K OK K K OK OK SE K OK K OK K SE OK K K OK K K K OK K K OK OK K K OK OK OK K K OK K K K OK OK K OK brief Execute main application param none return none PK 2K SE 2K K SE OK K K OK K K K OK OK K OK K K OK K K K K OK OK K K OK K K OK OK SE K OK K OK K OK K K K OK OK OK K OK OK K OK OK K OK OK OK OK K K OK K K K OK OK K OK OK KK EERE REE void BootloaderAPI ExecuteUserApplication void Change the Vector Table to the USER_FLASH_START SCB gt VTOR USER FLASH START amp Ox1FFFFF80 BootloaderAPI JumpBoot USER FLASH START MCU AN 510047 E 10 Page 13 co FUJITSU Chapter 5 Bootloader operations 5 5 Linker settings For using bootloader linker settings must be changed including Bootloader project linker settings It is configured in project no need to change User application project linker settings T
8. adar ip address port port number need to be bind u8ErrorType ERRORTYPE_SECURITY_ENABLED ERRORTYPE_VERSION_LOWER ERRORTYPE_VERSION_NOTSET ERRORTYPE_CODESIZE_OVERFLOW ERRORTYPE_ERASE_CHIP ERRORTYPE_FLASHWRITE_ERROR Return None Describe Tftp server send Error packet to client for feedback Note Tftp_SendDatagramPkt Sendback Ack to Tftp client Prototype void Tftp SendDatagramPkt struct udp_pcb upcb struct ip addr adar uint16 t port uint16 t block uint8 t data uint16 t datalenth MCU AN 510047 E 10 Page 32 co FUJITSU Appendix B API List Parameter upcb udp pcb to be send adar ip address port port number need to be bind block Ack block number data data buffer datalenth length of data buffer Return None Describe Tftp server send datagram packet to client and it can control datagram length Note RRQRecvedCallback Callback function when RRQ request received Prototype void RRQRecvedCallback void args struct udp_pcb upcb struct pbuf pkt_buf struct ip addr addr uint16 t u16 t port Parameter Args user supplied argument to match the callback function upcb udp pcb to be send pkt buf buffer stored with data packet port port number need to be bind Return None Describe This is a callback function when Tftp server received RRQ request Note Tftp_WRQRecvedCallback Callback function when WRQ request received Prototype void T
9. control medical life support system missile launch control in weapon system or 2 for use requiring extremely high reliability submersible repeater and artificial satellite Please note that FUJITSU SEMICONDUCTOR will not be liable against you and or any third party for any claims or damages arising in connection with above mentioned uses of the products Any semiconductor devices have an inherent chance of failure You must protect against injury damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy fire protection and prevention of over current levels and other abnormal operating conditions Exportation release of any products described in this document may require necessary procedures in accordance with the regulations of the Foreign Exchange and Foreign Trade Control Law of Japan and or US export control laws The company names and brand names herein are the trademarks or registered trademarks of their respective owners Copyright 2013 Fujitsu Semiconductor Limited Asia All rights reserved MCU AN 510047 E 10 Page 2 co FUJITSU Contents Contents REVISION HISTORY i s X M S 2 ee ene eee eee eee 3 1 INTRODUCTION 5 TD e 5 1 2 Reference DOCUIMBEMS UE UNUM CR 5 2 HARDWARE
10. owners co FUJITSU 32 BIT MICROCONTROLLER MB9B618T S SERIES ETHERNET BOOTLOADER MB9BF618T S SOFTWARE APPLICATION NOTE TM ARM ARM and Cortex M3 are the trademarks of ARM Limited in the EU and other countries co FUJITSU Revision History Hevision History Version Date Updated by Approved by Modifications 0 1 0 2013 3 25 ChamberTeng Initial version 0 2 0 2013 4 10 ChamberTeng Add bootloader API functions 0 3 0 2013 4 22 QuinnXu 1 Update 1 1 overview add update linkage for the Ethernet MAC driver 2 Update setup of HW in 6 3 3 3 Move the API introduction into appendix 4 Add note in 6 4 5 Add AN number MCU AN 510048 E 10 on the coverage 0 4 0 2013 4 23 ChamberTeng Delete function Tftp CalcSquare in sector 7 Specifications are subject to change without notice For further information please contact each office All Rights Reserved The contents of this document are subject to change without notice Customers are advised to consult with sales representatives before ordering The information such as descriptions of function and application circuit examples in this document are presented solely for the purpose of reference to show examples of operations and uses of FUJITSU SEMICONDUCTOR device FUJITSU SEMICONDUCTOR does not warrant proper operation of the device with respect to use based on such information When you develop equipment incorporating
11. 0047 E 10 Page 15 co FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 6 Quick start using FSSDC 9B618 EVB v1 0 6 1 Download Bootloader to Flash To use Ethernet bootloader customer must download the bootloader code to MCU flash Demo board FSSDC 9B618 EVB v1 0 support On Board Programming via USB This is convenient to download bootloader code to flash 6 1 1 Settings for USB On Board Programming e Hardware settings below Connector Function Setting MDO Mode setting short JP9 USB programming short When connecting with PC via USB cable the EVB can be identified as a USB device after power on 56005991 Figure 10 USB device Sign Check the COM port for this USB device in the device manager Ports COM amp LPT F Communications Port 1 Processors Secure biometrics devices Figure 11 COM Port in Device Manager Install the USB programmer usbdirect v01107 zip It can be downloaded from Fujitsu official website Run the software and set the parameter as shown in following figures and select Hex file Click Full Operation button U FLASH USB DIRECT Programmer SELECT FLASH INFORMATION Target MOU MBOBF618S T Ed SRER IEE End Addr 00000000 OOOFFFFFH 00100000H 00100000H 00100001H 00000002H COM 4 255 4 Command to Full Operation D E B P Set Environment Help
12. 18 6 32 Configure TFTP Client Settings 19 6 33 Fash 19 6 34 Flash with User Code sci muchnunnmnnwnucnmadimenimennine inns 20 6 4 Head User Code in Flash duri iced citta nbi satius 21 6 5 Erase User Code in usi einn ie tes a heise 21 7 BOOTLOADER API FUNCTIONS rre ru pa kt tis ieee ened 22 APPENDIX A MORE 24 APPENDIX 25 PPP 25 Bootloader 24444444000 25 BootloadgBr sIIUTTIDBOO uoi estie 25 Bootloader_ExecuteUserApplication 444444000 25 Bootloader UserCodeValid 022200000 0 0 0 26 MCU AN 510047 E 10 Page 3 co FUJITSU Contents Boolloader CheckEmply Ets 26 27 Bootloader 27 Bootloader 27 Bootloader ConfigureEthernetPIns tnra irn nro ib 28 Bootloader EthernetlAPlnit cccccccccsssseeccceeccceeee
13. Check SUM Version Info Download USB Figure 12 settings of USB programmer MCU AN 510047 E 10 Page 16 FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 FLASH USB DIRECT Programmer Target MCU p 00100000H 00000002H COM 1 255 Please reset the microcontroller userboard Then push OK button Command to mm amp Compare Figure 13 reset message during programming Reset EVB first and then press OK button in USB programmer FLASH USB DIRECT Programmer SELECT Target MOU Size 00100000H 00000002H 2049 2049 Hex File It ended normally completel COM 1 255 J eh ai d Command to Q com Figure 14 programming complete successfully Download Program amp Please refer to FSS MB9B618S EV Board User Manual pdf for the details MCU AN 510047 E 10 Page 17 co FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 6 2 Configure User Application Code Customer must set user application code as mentioned in sector 5 5 2 and 5 6 Set user application code linker settings gt Vector Start Address set to 0 0002 0000 gt Memory Regions set Rom Start address to 0x0002_0000 gt Rom End address depends on the code size Then configure user code version information as described in sector 5 6 and b
14. e void LED Init void MCU AN 510047 E 10 Page 28 co FUJITSU Appendix B API List Parameter None Return None Describe Initial IO ports for LED state control Note Flash module FlashRomEraseSector Initial Ethernet IAP function Prototype int32 t FlashRomEraseSector uint32 t u32SectorEraseAddress Parameter u32SectorEraseAdaress flash sector address need to be erase Return int32 t FLASH OK FLASH Describe Erase one flash sector Note FlashDataPolling Data Polling alogithm Prototype int32 t FlashDataPolling uint32 t u32PollAddress uint16 t u16PollData Parameter u32PollAddress Polling address u16PollData Polling data Return int32 t FLASH OK flash polling OK FLASH TIMEOUT flash polling error MCU AN 510047 E 10 Page 29 co FUJITSU Appendix B API List Describe A flash data polling alogithm Note FlashRomProgram Write data to specified flash area Prototype int32 t FlashRomProgram uint32 t u32ProgramAddress uint16 t 16 Parameter u32ProgramAdaress target address u16ProgamData specified data Return int32_t FLASH OK flash polling OK FLASH TIMEOUT flash polling error Describe This function is mainly at write data to flash memory Note 1 Itonly can write half word 16 bit data to flash memory 2 2 must be even value Tftp server module Tftp DecompressPktLenth Decompre
15. eeeseceeeeeseeseeseaeusceeeeeseseaeaaaees 28 LED Init28 c cp ee 29 FlashRomEraseSector ET 29 FashData Poling se TEE E OE 29 Elashibomb FOGOEIITI Ebcu bU Eu nM ecu PC MIN UM S 30 aie UE 30 Tfip DecompressPKILentli ice ne en rrr n ret rens m 30 i uezr succo 31 Te sieut cox i I Cai EUM cee 31 5 insu xU ee ef 32 Tp sendbatagramb KE 1 eee 32 _RRQRecvedCallback 33 WHRSGvedGallBack csse vua ermita Rx 33 imi 9s 34 liie cc 34 Tfto_RecvCallback MC W 35 Tip IDEM TU 36 MCU AN 510047 E 10 Page 4 co FUJITSU Chapter 1 Introduction 1 Introduction 1 1 Overview This document describes the implementation of an Ethernet boot loader which is based LwIP1 4 0 middleware and Fujitsu Ethernet driver library Ethernet boot loader can be used to update user applications per Ethernet network This solution is designed primarily for Fujitsu microcontroller with existing evaluation boards The functions include Supports TCP IP stack such as ICMP
16. er settings are correct Compile and build the binary file BIN Any unclear please refer to chapter 5 5 and chapter 5 6 MCU AN 510047 E 10 Page 19 FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 After download bootloader code into internal flash specified user application code area is default empty Power on the demo board system will enter bootloader mode directly 1 Configure TFTP client settings as Figure 10 2 Power on the EVB with Ethernet cable plugged into Ethernet PortO J1 3 After PC assigned IP address press 3CDaemon Go button to download user code After datagram transferred successfully demo board will execute the sample code and 3CDaemon will display like below TFTP Server Address 192 1 68 1 20 T Operation Transfer Mode Send file C Wet scii ASCII mode Receive File Octet Binary Remote File Name v1 1 rile heme D TestCodeStore Led_Blink bin E Advanced Not supported by most TFTP Servers 1783 Blocksize Negotiatior 512 Blocksize RFC 1784 Timeout Negotiatior Seconds 10 RFC 1784 Transfer size Negotiatior Stop Progress Send of done 1104 bytes 0 KB sec Once you have completed the form Click the GO Figure 16 data transferred successfully 6 3 4 Flash with User Code This part will describe the condition when user code is already in flash Use the steps in chapter 6 2 1 to enter bootloade
17. ftp_WRQRecvedCallback void args MCU AN 510047 E 10 Page 33 co FUJITSU Appendix B API List struct pcb upcb struct pbuf pkt buf struct ip addr adar uint16 t u16 t port Parameter Args user supplied argument to match the callback function upcb udp pcb to be send pkt buf buffer stored with data packet port port number need to be bind Return None Describe This is a callback function when Tftp server received WRQ request Note WRQRecved Callback function when WRQ request received Prototype void WRQhRecved struct pcb upcb struct ip addr lpAddr uint16 t port struct pbuf pkt buf Parameter upcb udp pcb to be send IpAdar IP address port port number need to be bind pkt buf buffer stored with data packet Return None Describe Some operations when WRQ request received Note Tftp RRQRecved Callback function when RRQ request received Prototype MCU AN 510047 E 10 Page 34 co FUJITSU Appendix B API List void RRQRecved struct pcb upcb struct ip addr lpAddr uint16 t port struct pbuf pkt buf Parameter upcb udp pcb to be send IpAdar IP address port port number need to be bind buf buffer stored with data packet Return None Describe Some operations when RRQ request received Note Tftp RecvCallback Callback function when received data through UDP protocol Prototype void Tftp RecvCallback void arg s
18. ge 11 FUJITSU Chapter 5 Bootloader operations The code allocation of this demo as follows I RAM Flash OP code Internal RAM SA4 SA7 32K Updater Free space Sectors of Demo User User code Code SA10 SA23 128K 896KB Figure 7 code allocation Internal ROM The Ethernet loader code of MCU will be allocated at the SA4 SA7 The user application program will be allocated at SA10 SA23 whose vector table shall be placed at the beginning of the sector 0x20000 0x200FF 1 Vector Table 256B 0x20100 0x2010F Version Flag 4 12B reserved 0x20110 0x3FFFF 1 User Code 128KB Figure 8 sample memory Maximum 128KB Maximum code size can be defined by customer using settings in bootloader bootloader h The maximum size can reach up to 896KB MCU AN 510047 E 10 Page 12 co FUJITSU Chapter 5 Bootloader operations 54 Jump into user application To start the user application code the stack pointer and vector table must be updated Following procedure is called to start the user application code linked to 0x0002 0000 define USER FLASH START 0 00020000 KKK KK KK brief Jump to user code application param u32Address Address of user code return none PK SK SE OK SE OK K OK K OK SK K K OK OK K OK CE K K K K
19. his one must be set in the user application projects 5 5 1 Bootloader linker settings When writing data into internal flash flash operations must be copied into RAM to process This can be configured in the linker files normally done by the IDE start up code The ROM flash area should be set to use only 0x0000 0000 to 0x0000 7FFF To copy Flash erase programming routines to RAM automatically after start up and be executed later in RAM the following lines should be added to the linker file icf define symbol RAM func start 0x20000000 define symbol RAM func end 0x20007FFF define region RAM func region mem from RAM func start _ to RAM func end 1 define block RamCode section flash ram code place in RAM func region block RamCode 5 5 2 User application code linker settings To coordinate the application start address in bootloader project the following lines should be re added in the standard template linker files icf Specials define symbol CFEDIT intvec start 0x00020000 Memory Regions define symbol CFEDIT region ROM start 0x00020000 This can be done also via Project gt Options gt Linker where intvec start and ROM start can be specified as well MCU AN 510047 E 10 Page 14 co FUJITSU Chapter 5 Bootloader operations Options for node mb9bf6lxt ethernet Linker configuration file ed
20. int32 t DecompressPktLenth uint8 t pu8PktBuf static void SendBaseMessage struct udp pcb upcb struct ip addr uint16 t port uint8 t buf uint16 t buflen void Tftp SendAckPkt struct udp pcb struct ip addr uint 6 t port uint16 t block void Tftp SendErrorPkt struct pcb upcb struct ip addr addr uint 6 t port uint8 t u8ErrorType void Tftp SendDatagramPkt struct pcb upcb struct ip addr uint16 t port uint16 t block uint8 t data uint 6 t datalenth void RRQRecvedCallback void args struct pcb upcb struct pbuf buf struct ip addr addr u16 t port void Tftp WRQRecvedCallback void args struct udp pcb upcb struct pbuf pkt buf struct ip addr addr u16 t port void Tftp_WRQRecved struct pcb upcb struct ip addr lpAddr uint16 t port struct pbuf pkt buf void RRQRecved struct pcb upcb struct ip addr IpAddr uint16 t port struct pbuf pkt buf void Tftp RecvCallback void arg struct udp pcb upcb struct pbuf pkt buf struct ip addr addr u16 t port void Tftp server init void MCU AN 510047 E 10 Page 23 FUJITSU Appendix A More Information Appendix More Information For more Information on FUJITSU semiconductor products visit the following websites English version address http www fujitsu com global services microelectronics product micom support
21. itor n Vector Table Memory Regions Stack Heap Sizes Category Factory Settings intvec 0 00020000 General Options C C Compiler Assembler Output Converter Config Library Input Optimizations Advanced Custom Build Build Actions Linker configuration file V verride default Debugger PROJ_DIRG confi g mb9b icf Simulator GDB Server Linker configuration file editor TAR ROM monitor Configuration file symbol definitions one per line L jet JTAGjet Memory Regions i Jnk Trace Vector Table Stack Heap Sizes TI Stellaris Start End T ROM 0x00020000 OxODO3FFFF RDI IN RAM Ox 1 fFFOOOO Ox200FFFF Third Party Driver TI XDS100 Mua A EST Fixed Not fixed but smaller than settings in bootloader Figure 9 user code project settings 5 6 User application code version number settings Step 1 Define version information array pragma location INFORSEC INFORSEC const char sVersion 16 V 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Step 2 Quote version information array in main function char addr char sVersion Step 3 Add memory placement command to file place in ROM region readonly place in RAM region readwrite block CSTACK block HEAP place at address mem 0x00020100 section INFORSEC This command is used to locate variables of sVersion to 0x0002 0100 MCU AN 51
22. on of ENABLE FLASH SECURITY in bootloader h is enabled the user code can t be read out And 3CDaemon will display error message Progress Received error from peer flash security secured can t be read Note The only way to make the use code readable is by erasing the security bit of MCU flash with Fujitsu USB on board program tool chip erase and then flash the use code again TFTP Server Address 1 92 168 1 20 Operation Transfer Mode 27 Send file NetAscii ASCII mode Receive File Octet Binary Mode Remote File Name via ERES D TestCadeStore Led Button bin Advanced Not supported by most TFTP Servers 1783 Blocksize Negotiatior Blocksize 512 RFC 1784 Timeout Negotiatior Seconds 10 RFC 1784 Transfer size Negotiatior Progress Received error from peer flash secured can not read Once you have completed the form Click the GO Figure 18 flash secured 6 5 Erase User Code in Flash This demo supports erase user code flash area through using special command Configure 3CDaemon exe settings as figure 14 Type command Erase in Remote File Name Then press button MCU AN 510047 E 10 Page 21 FUJITSU Chapter 7 Bootloader API functions TFTP Server Address 192 168 1 20 Uperation Transfer Mode C ASCII mode Receive File Octet Binary Mode Remote File Name Leslie eR D TestCodeStoresLed Blink bin
23. ons ser code empty no Enter key pressed Delay 0 5s Key pressed yes Delayed 5s Jump to Flash loader Figure 5 run mode judgement MCU AN 510047 E 10 Page 10 FUJITSU Chapter 5 Bootloader operations 5 3 Memory map As described in the Technical Reference Manual of ARM for Cortex M3 core ARM Cortex microcontrollers have its flash memory starting at 0 0000 0000 RAM memory starting at 0 2000 0000 and so 1004 CR trimming data Security code 0 0010 0000 0 0010 0000 23 64 22 64 OxOO0E 0000 SA21 64KB SA20 64KB 0 000 0000 SA19 64KB SA18 64KB 0 000 0000 SA17 64KB SA16 64KB 0x0008 0000 SA15 64KB SA14 64KB 0 0006 0000 SA13 64KB SA12 64KB 0 0004 0000 SA11 64KB SA10 64KB 0 0002 0000 SA9 48KB SA8 48KB Flash memory 1024KB 0 0000 8000 0 0000 4000 0 0000 0000 SA6 8KB SA5 8KB SA4 8KB gt i bite3 bit32bit31 bit Figure 6 M9BF618S flash memory As defined for ARM Cortex M3 MCUs the vector table starts with the stack pointer followed by the reset vector and so on The vector table of the bootloader is fixed to 0x0000 0000 and the user code must be linked to upper areas of the flash memories For Fujitsu Ethernet bootloader the user code starts from 0x0002 0000 MCU AN 510047 E 10 Pa
24. protection and prevention of over current levels and other abnormal operating conditions If any products described in this document represent goods or technologies subject to certain restrictions on export under the Foreign Exchange and Foreign Trade Law of Japan the US Export Administration Regulations or the applicable laws of any other country the prior authorization by the respective government entity will be required for export of those products Trademarks and Notice The contents of this document are subject to change without notice This document may contain information on a Spansion product under development by Spansion Spansion reserves the right to change or discontinue work on any product without notice The information in this document is provided as is without warranty or guarantee of any kind as to its accuracy completeness operability fitness for particular purpose merchantability non infringement of third party rights or any other warranty express implied or statutory Spansion assumes no liability for any damages of any kind arising out of the use of the information in this document Copyright 2013 Spansion Inc All rights reserved Spansion the Spansion logo MirrorBit MirrorBit Eclipse ORNAND and combinations thereof are trademarks and registered trademarks of Spansion LLC in the United States and other countries Other names used are for informational purposes only and may be trademarks of their respective
25. r mode Please confirm typing correct commands in Remote File Name of 3CDaemon window Version number should be same with the settings in user code project refer to chapter 5 6 If version is lower or the same as the code in flash already TFTP client will display error command as below TFTP Server Address 192 168 1 20 Operation Transfer Mode Send NetAscii ASCII mode Receive File f Octet Binary Mode Remote File Name 1 0 estCodeStore Led_Blink bin Advanced Not supported by most TFTP Servers RFC 1783 Blocksize Negotiatior Blocksize 512 RFC 1784 Timeout Negotiatior Seconds 10 RFC 1784 Transfer size Negotiatior Stop Progress Received error from peer version lower Once you have completed the form Click the GO MCU AN 510047 E 10 Page 20 co FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 Figure 17 code version number lower If code size is bigger than the defined size in bootloader 3CDaemon will display error command Progress Received error from peer code oversize If format of version number is not correct 3CDaemon will display Progress version format error 6 4 Read User Code in Flash All steps are the same as flash empty section 6 3 3 except changing operation mode to Receive File in SCDaemon If Flash is secured address 0x0010 0000 is written with Ox0001 as well as the macro definiti
26. sample fm3 h tml http mcu emea fujitsu com mcu_product mcu_all_software htm http www fujitsu com cn fss mcu lineup fm3 MCU AN 510047 E 10 Page 24 co FUJITSU Appendix B API List Appendix B API List Bootloader module Bootloader ReadFlashSecurityBit Read flash security statement Prototype uint16 t Bootloader ReadFlashSecurityBit void Para None Return uint16 t the stored value of flash security bit Describe Note Bootloader JumpBoot Jump to user code application Prototype void Bootloader JumpBoot uint32 t u32Address Parameter u32Address Address of user code Return None Describe Note Bootloader ExecuteUserApplication Execute user application code Prototype void Bootloader ExecuteUserApplication void Parameter MCU AN 510047 E 10 Page 25 co FUJITSU Appendix API List None Return None Describe Note Bootloader UserCodeValid Judge whether the user code is valid Prototype boolean t Bootloader_UserCodeValid void Parameter None Return Bootlean t TRUE user code is valid FALSE user code is not valid Describe This function will judge whether the bootloader user code area is empty and user code is valid Note Bootloader CheckEmpty Check whether user code area is empty Prototype boolean t Bootloader CheckEmpty void Parameter None Return TRUE user code area is empty FALSE user code area is not empty
27. sing controllers and Wireless BLE Bluetooth Low Energy and USB connectivity solutions Cypress is committed to providing its customers worldwide with consistent innovation best in class support and exceptional system value SPANSION a Colophon The products described in this document are designed developed and manufactured as contemplated for general use including without limitation ordinary industrial use general office use personal use and household use but are not designed developed and manufactured as contemplated 1 for any use that includes fatal risks or dangers that unless extremely high safety is secured could have a serious effect to the public and could lead directly to death personal injury severe physical damage or other loss i e nuclear reaction control in nuclear facility aircraft flight control air traffic control mass transport control medical life support system missile launch control in weapon system or 2 for any use where chance of failure is intolerable i e submersible repeater and artificial satellite Please note that Spansion will not be liable to you and or any third party for any claims or damages arising in connection with above mentioned uses of the products Any semiconductor devices have an inherent chance of failure You must protect against injury damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy fire
28. ss total packet length of Tftp trans file Prototype uint32 t DecompressPktLenth uint8 t pu8PktBuf Parameter pu8PktBuf datagram packet buffer Return 2 t datagram packet total length Describe This function can decompress total length of file Note This decompress function is only for WRQ request MCU AN 510047 E 10 Page 30 co FUJITSU Appendix B API List Tftp SendBaseMessage Send basic data packet using UDP protocol Prototype void SendBaseMessage struct pcb upcb struct ip addr adar uint16 t port uint8 t buf uint16 t buflen Parameter upcb udp pcb to be send addr ip address port port number need to be bind buf datagram packet buffer buflen datagram packet buffer length Return None Describe Note Tftp SendAckPkt Sendback Ack to Tftp client Prototype void SendAckPkt struct pcb upcb struct ip addr addr uint16 t port uint16 t block Parameter upcb udp pcb to be send adar ip address port port number need to be bind block Ack block number Return None Describe MCU AN 510047 E 10 Page 31 co FUJITSU Appendix B API List Tftp server send Ack packet to client for feedback Note Tftp_SendErrorPkt Sendback ERROR packet to Tftp client Prototype void Tftp SendErrorPkt struct udp pcb upcb struct ip addr uint16 t port uint8 t u8ErrorType Parameter upcb udp pcb to be send
29. the device based on such information you must assume any responsibility arising out of such use of the information FUJITSU SEMICONDUCTOR assumes no liability for any damages whatsoever arising out of the use of the information Any information in this document including descriptions of function and schematic diagrams shall not be construed as license of the use or exercise of any intellectual property right such as patent right or copyright or any other right of FUJITSU SEMICONDUCTOR or any third party or does FUJITSU SEMICONDUCTOR warrant non infringement of any third party s intellectual property right or other right by using such information FUJITSU SEMICONDUCTOR assumes no liability for any infringement of the intellectual property rights or other rights of third parties which would result from the use of information contained herein The products described in this document are designed developed and manufactured as contemplated for general use including without limitation ordinary industrial use general office use personal use and household use but are not designed developed and manufactured as contemplated 1 for use accompanying fatal risks or dangers that unless extremely high safety is secured could have a serious effect to the public and could lead directly to death personal injury severe physical damage or other loss i e nuclear reaction control in nuclear facility aircraft flight control air traffic control mass transport
30. truct udp pcb upcb struct pbuf pkt buf struct ip addr addr u16 t port Parameter arg user supplied argument to match the callback function upcb udp pcb to be send pkt buf buffer stored with data packet adar IP address port port number need to be bind Return None Describe Some operations when received data through UDP protocol Note MCU AN 510047 E 10 Page 35 co FUJITSU Appendix API List Tftp server init Initial tftp server Prototype void Tftp_server_init void Parameter None Return None Describe Initial tftp server Note MCU AN 510047 E 10 Page 36
31. uild the user code into binary file 6 3 Download User Code to Flash 6 3 1 Enter Ethernet bootloader mode If user code flash area is empty no user code the MCU will enter bootloader mode directly after power on And LED D14 will turn ON when running in bootloader mode If user code exits in the specified flash area MCU may execute user application code directly At this condition we have two methods to enter bootloader mode Method 1 Press joystick OK button middle button of the joystick without release then power on the demo board After 5 seconds LED D14 will turn on indicating demo board enters bootloader mode Then release the button Method 2 When demo board is power on the existing user application will be executed Press the joystick OK button without release Then press reset key RST1 to reset MCU After 5 seconds the D14 turns on indicating demo board enters bootloader mode Then release the button Then release the button MCU AN 510047 E 10 18 FUJITSU Chapter 6 Quick start using FSSDC 9B618 EVB v1 0 6 3 2 Configure TFTP Client Settings We need a TFTP client to transmit user application code to internal flash For this demo we choose 3CDaemon exe to serve as a TFTP client aco File View Operations Help TFTP Server FIPS TFTP Server Addres amp 192 158 1 20 Operation Tansler Mode ale i TFIPCient 1 Remote File Name 5
32. ulator J link IAR MCU AN 510047 E 10 Page 7 FUJITSU Chapter 4 Features 4 Features bin code sample bin Application Middleware Hardware Low level Ethernet interface ethernetif c Driver Ethernet driver Emac c Ethphy c Hardware SS Figure 3 project block diagram Hardware Driver Ethernet driver Middleware LwIP 1 4 0 Application TFTP server Flash programming MCU internal flash Ethernet flash loader contains TFTP server and flash programming driver MCU AN 510047 E 10 Page 8 FUJITSU Chapter 5 Bootloader operations 5 Bootloader operations 5 1 Project Structure 18 Debug Files E mb9bf6 1xt ethernet MB a bootloader E bootloaderapi c E button c ethernetconfig c flash c La C3 ethernet emac c ethphy c Cafm3adaption 2213 Cilwipapp Ha G source_files E main c fem Startup_mb9bf6 1x s test framework E scheduler c tasks c EWARM 6 30 7 README txt Readme txt Output Figure 4 project structure 5 2 Main loop Before initializing boot loader the main loop checks the following items Specified flash validation Start up key button status Figure 5 is the software procedure of running mode selection MCU AN 510047 E 10 Page 9 co FUJITSU Chapter 5 Bootloader operati
Download Pdf Manuals
Related Search
Related Contents
IBM ILOG OPL IDE Tutorials Hobart ML-29269 User's Manual User Manual - Entertainment Partners Ice-O-Matic ICEU070 User's Manual 消費者政策のこれまでとこれから Business Partner Brochure 1A 2A 3A 1A CF15118 CompactFlash Carrier utilityModules User`s Manual Oldsmobile C550 User's Manual User Manual Copyright © All rights reserved.
Failed to retrieve file