Fujitsu FR Series Application Note
Fujitsu FR Series Application Note

Fujitsu FR Series Application Note

32-bit microcontroller
Hide thumbs Also See for FR Series:

Advertisement

Quick Links

Fujitsu Microelectronics Europe
FMEMCU-AN-910011-18
Application Note
FR FAMILY
32-BIT MICROCONTROLLER
MB91360
EMULATION OF THE MB91360
SERIES
APPLICATION NOTE

Advertisement

Table of Contents
loading

Summary of Contents for Fujitsu FR Series

  • Page 1 Fujitsu Microelectronics Europe FMEMCU-AN-910011-18 Application Note FR FAMILY 32-BIT MICROCONTROLLER MB91360 EMULATION OF THE MB91360 SERIES APPLICATION NOTE...
  • Page 2: Revision History

    New format, adapted to new procedure files for flash programming 22. Sept. 03 V1.7 corrected Table 4, ROMA=1 internal ROM mode 07. Nov. 03 V1.8 corrected typos This document contains 35 pages. AN-910011-18 - 2 - © Fujitsu Microelectronics Europe GmbH...
  • Page 3: Warranty And Disclaimer

    Product or parts thereof, if the Product is returned to Fujitsu Microelectronics Europe GmbH in original packing and without further defects resulting from the customer´s use or the transport.
  • Page 4: Table Of Contents

    5 APPENDIX ........................23 Comparison between debugging with external SRAM and internal FLASH memory ..........................23 Source Code of the procedure files................ 23 5.2.1 CS0_ADR_000000h.PRC ................ 23 5.2.2 CS0_ADR_180000h.PRC ................ 24 AN-910011-18 - 4 - © Fujitsu Microelectronics Europe GmbH...
  • Page 5 Contents 5.2.3 PLL_32MHz.PRC..................24 5.2.4 prog_flash.prc ..................25 5.2.5 set_EVA_mode.PRC................25 5.2.6 flash.prc ....................26 5.2.7 start_FLASH.prc ..................31 5.2.8 start_RAM.prc ..................33 © Fujitsu Microelectronics Europe GmbH - 5 - AN-910011-18...
  • Page 6: Introduction

    This document describes the procedure to start an emulator debugging session. There are 2 possible approaches: 1. Using external RAM for program code 2. Using MCU internal Flash memory for program code A comparison between these 2 possibilities is listed in section 5.1 AN-910011-18 - 6 - © Fujitsu Microelectronics Europe GmbH...
  • Page 7: The Fr Emulation System

    1 The FR Emulation System 1.1 Hardware of the Emulation System for the FR-family Fujitsu provides a complete emulation system for their 32bit RISC-MCU’s of the MB91360- serie. Figure 1 shows this emulation system, it consists of the Main Unit MB2197-01, the Evaluation-Board MB2197-120 and the target StarterkitMB91360.
  • Page 8: Evaluation Chip Mb91Fv360

    0xFFFFF, the Eva-Chip must be set to EXTERNAL-ROM-mode because the debugger can upload the code only to the external SRAM of the evaluation board. The debugger can’t upload the code to the MCU-internal flash memory. AN-910011-18 - 8 - © Fujitsu Microelectronics Europe GmbH...
  • Page 9: Mb91Fv360 Operating Modes

    0x40000 and 0xFFFFF are accesses via internal resources the external bus interface. • Internal resources like Fast-RAM, Boot- ROM and Flash memory are disabled and can’t be accessed Table 1 details of each operating mode © Fujitsu Microelectronics Europe GmbH - 9 - AN-910011-18...
  • Page 10 MCU to INTERNAL ROM mode. Thus the MCU can only be set to EXTERNAL ROM mode, when pin MD0 is set to high and the ROMA bit at the external address is set to low. AN-910011-18 - 10 - © Fujitsu Microelectronics Europe GmbH...
  • Page 11 MD0 = 0 value is fix INTERNAL ROM mode MD0 = 1 MODR.ROMA = 1 INTERNAL ROM mode MD0 = 1 MODR.ROMA = 0 EXTERNAL ROM mode Table 4 © Fujitsu Microelectronics Europe GmbH - 11 - AN-910011-18...
  • Page 12: Setting The Mb91Fv360 To External Rom-Mode

    MD0 to VCC (dipswitch S1:MD0 to OFF) action: set mode data and reset vector reset MCU in external memory MCU: external ROM mode Figure 3 sequence to set the MCU to external ROM mode AN-910011-18 - 12 - © Fujitsu Microelectronics Europe GmbH...
  • Page 13: Routing The Cs0-Line To The External Ram Of The Emulation Adapter Board

    Chapter 3 Setting the MB91FV360 to External ROM-mode Fujitsu provides a set of batch files (start_ram.prc, etc.), which can be called form the debugger of Softune Workbench. “start_ram.prc” is the main procedure file which calls other procedure files subroutines. Sub-procedure files CS0_ADR_000000h.prc,...
  • Page 14: Set Mode Pins Md0-Md2 On The Starterkit

    Softune’s Workbench resets the MCU to internal mode. Now mode data and reset vector can be set in external SRAM by the sequence of the batch file “start_ram.prc”. This batch file is called before the application is loaded to the emulator. AN-910011-18 - 14 - © Fujitsu Microelectronics Europe GmbH...
  • Page 15: Setting The Mode Pin Md0 At Dipswitch S1 (Figure 6) To Off

    Beside the automatically execution of the procedure file before loading the application (set in the debugging configuration, refer to section 3.2), the procedure file can be called manually via the command window of the debugger (Figure 9) or by the command batch start_ram.prc. © Fujitsu Microelectronics Europe GmbH - 15 - AN-910011-18...
  • Page 16 Chapter 3 Setting the MB91FV360 to External ROM-mode Figure 9 command window of the debugger AN-910011-18 - 16 - © Fujitsu Microelectronics Europe GmbH...
  • Page 17: Faq's

    Solution: set mode pin MD0 to low ( MDO at dipswitch S1 to on) and click reset button at debugger of Softune Workbench. Afterwards set mode pin MD0 to high ( MDO at dipswitch S1 to off) and call the batch file (Figure 8) © Fujitsu Microelectronics Europe GmbH - 17 - AN-910011-18...
  • Page 18: Verify Error At Address Of Area Between 0X80000 And 0Xfffff

    Cause: MCU is not set to external ROM mode Solution: check routing CS0 set MD0 to low click reset button of debugger of Softune Workbench set MD0 to high call menu Debug->Load Target AN-910011-18 - 18 - © Fujitsu Microelectronics Europe GmbH...
  • Page 19: Setting The Mb91Fv360 To Internal Rom Mode And Programming The Internal Flash

    CS0 to the external SRAM on the emulation adapter board. Figure 12: Configuration of debugger for debugging in flash memory. The procedure file “start_flash.prc” calls the following procedure files as sub-functions: CS0_ADR_180000h.prc, PLL_32MHz.prc. © Fujitsu Microelectronics Europe GmbH - 19 - AN-910011-18...
  • Page 20: Programming The Internal Flash Memory

    Furthermore the flash programming routines, which are uploaded to the MCU by the flash.prc procedure file, must be present in the PRC\ subdirectory. These routines are contained in the abs-file: “flash.abs”. AN-910011-18 - 20 - © Fujitsu Microelectronics Europe GmbH...
  • Page 21: Routing Of The Chip Select Cs0 Signal

    The project name, i.e. the name of the binary file, which will be programmed into the FLASH memory, must be set in the procedure file prog_flash.prc: adapt this line to the batch prc\start_flash.prc actual project name batch prc\flash.prc,abs\Template,0x80000 © Fujitsu Microelectronics Europe GmbH - 21 - AN-910011-18...
  • Page 22: Summary

    Generate binary file of the application code (m2bs.exe converter tool). • Adapt the “prog_flash.prc” procedure file to the actual project name. • Start debugger, execute procedure file “prog_flash.prc” prior loading of the target file. AN-910011-18 - 22 - © Fujitsu Microelectronics Europe GmbH...
  • Page 23: Appendix

    Table 5 Summary 5.2 Source Code of the procedure files 5.2.1 CS0_ADR_000000h.PRC # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES.
  • Page 24: Cs0_Adr_180000H.prc

    # only CS0 enabled for ROM-download enable verifymode 5.2.2 CS0_ADR_180000h.PRC # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES.
  • Page 25: Prog_Flash.prc

    487=10 # extBus/2 5.2.4 prog_flash.prc # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES. (C) Fujitsu Microelectronics Europe GmbH batch prc\start_flash.prc...
  • Page 26: Flash.prc

    T\n" printf "\n" 5.2.6 flash.prc # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES. (C) Fujitsu Microelectronics Europe GmbH procedure file flash.prc...
  • Page 27 0: call CSO_ADR_180000h.prc 1: set stackpointer and framepointer 2: blank check with sector erase 3: load binary file 4: copy program into flash 5: verify 6: load debug information #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- © Fujitsu Microelectronics Europe GmbH - 27 - AN-910011-18...
  • Page 28 1: check memory at stackpointer ######################################################## set reg r15=0x3c800 set reg r14=0x3cA00 ######################################################## 2: blank check ######################################################## printf "blank check (0x80000,0x01FFFF)\n" call /NODISPLAY fBLANK (0x80000,0x01FFFF) if (%CALL & 0x000000FF) == 0 AN-910011-18 - 28 - © Fujitsu Microelectronics Europe GmbH...
  • Page 29 "blank check (0xF4000,0x03FFF)\n" call /NODISPLAY fBLANK (0xF4000,0x03FFF) if (%CALL & 0x000000FF) == 0 printf " sector not empty!\n" printf " erase sequence is started!\n" printf " do not interrupt erase sequence\n" © Fujitsu Microelectronics Europe GmbH - 29 - AN-910011-18...
  • Page 30 ######################################################## 5: verify ######################################################## printf "verify ... " call /NODISPLAY verify_area (0x180000, %P1, ((%vFILESIZE +1) / 2)) if %CALL == 0 printf " OK \n" else printf " error at 0x%X\n",%CALL AN-910011-18 - 30 - © Fujitsu Microelectronics Europe GmbH...
  • Page 31: Start_Flash.prc

    END OF PROCEDURE FILE \n" CANCEL LOGGING 5.2.7 start_FLASH.prc # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES. (C) Fujitsu Microelectronics Europe GmbH...
  • Page 32 "\n mode pins NOT set correctly!!!\n" printf "\n" printf "\nset mode pins and restart procedure file!\n" printf "\n========================================================" QUIT endif # MODE_REGISTER printf "\nend of procedure file : start_FLASH.prc\n" cancel logging AN-910011-18 - 32 - © Fujitsu Microelectronics Europe GmbH...
  • Page 33: Start_Ram.prc

    Chapter 5 Appendix 5.2.8 start_RAM.prc # THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU # MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR # ELIGIBILITY FOR ANY PURPOSES. (C) Fujitsu Microelectronics Europe GmbH # start_RAM.prc...
  • Page 34 M M M B\n" printf " D D D O\n" printf " 2 1 0 O\n" printf " T\n" printf "\n" printf "\nset mode pins and restart procedure file!\n" printf "\n========================================================" printf "\n" AN-910011-18 - 34 - © Fujitsu Microelectronics Europe GmbH...
  • Page 35 Chapter 5 Appendix endif printf "\nend of procedure file : start_RAM.prc\n" cancel logging © Fujitsu Microelectronics Europe GmbH - 35 - AN-910011-18...

This manual is also suitable for:

Mb91360

Table of Contents