Part Number Hot Search : 
25L4005A S2405 CP12C60 3N60C 53111 2SA650 53111 C5000
Product Description
Full Text Search
 

To Download AN1474 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN1474/1001 1/10 AN1474 application note st92f150 and st92f120 problem resolution guidelines by microcontroller division applications introduction the st92f120 and st92f150 are part of the same family of powerful microcontrollers from stmicroelectronics, featuring single voltage flash memory and an innovative e3prom concept. this document gives guidelines on resolving several common application problems that have been reported by st application engineers. testflash features the testflash features are described in the st92f120 and st92f150 datasheets. located in a reserved flash area, the testflash contains the bootcode which performs the e3prom initialization, provides the possibility to program the flash by in system programming (refer to the application note an1450 st9 flash programming for a detailed description) and then jumps to the start address application code via the reset vector. 1
2/10 st92f150 and st92f120 problem resolution guidelines 1 external watchdog routine during the bootcode execution (from 12.5 ms up to 75ms if an aborted e3prom write operation is detected), a code routine provided by the user may be executed to refresh an external watchdog. the routine address offset is located at addresses 0x000006h and 0x000007h while the seg- ment where the routine is located has to be written in 0x000009h. you must fill the word at the address 0x000006h with 0xffffh if your application does not use an external watchdog. startup file example (usually called crtbegin.spp) : .org 0x06 .word 0xffff refer to the application examples provided with the st9+ user guide. 1.1 problem description the application is not executed at all and it is not possible to communicate by isp with the pro- gramming board. 1.2 analysis when the chip is read directly with the programming board, the contents of addresses 0x000006h and 0x000007h is not equal to 0xffh. these addresses in the application code are not equal to 0xff whereas an external watchdog routine is not provided. 1.3 resolution modify the application code as mentioned at the beginning of this section and erase and re- program the device. there is no way to modify this chip by isp, it has to be unsoldered. 2
3/10 st92f150 and st92f120 problem resolution guidelines 2 st92f120 reset vector one of the powerful features provided by the st9 flash device family is the possibility to up- grade the application code by downloading and programming through an i/o interface on the mcu (refer to the application note an1275 in application programming for the st92f120 for a detailled description). in case of a parasitic reset during the flash upgrade operation, the application must be able to recover safely by executing the bootloader code. to perform this, the bootloader is present in the flash sector where the application starts, the one pointed to by the reset vector. this sector must never be erased. this is why the reset vector is always located in the smallest sector. st92f120 60kbyte flash device map st92f120 128kbyte flash device map st92f150 60 kbyte flash device map st92f150 128kbyte flash device map sector size f0 4 kbyte f1 48 kbyte f2 8 kbyte sector size f0 64 kbyte f1 48 kbyte f2 8 kbyte f3 8 kbyte sector size f0 8 kbyte f1 8 kbyte f2 32 kbyte f3 12 kbyte sector size f0 8 kbyte f1 8 kbyte f2 48 kbyte f3 64 kbyte
4/10 st92f150 and st92f120 problem resolution guidelines 2.1 special reset vector mapping in st92f120 128kbyte flash device the reset vector is located at the beginning of sector f0, at address 0x000000, in all st92f150 and st92f120 microcontrollers but one : the st92f120 128kbyte flash device. in this device, the reset vector is located in 0x01e000h, at the begining of the sector f3. the st92f120 emulator has the same behaviour as the st92f120 60kbyte flash device : its reset vector is located in 0x000000h, at the beginning of sector f0. so, how to emulate an st92f120 128kbyte flash device ? there are two possibilities : 1. the application startup code is located in sector f3 and an instruction is added to jump from sector f0 to sector f3. this jump is executed by the emulator but not by the final application. 2. the application startup code is located in f3 and an instruction is added to jump from sec- tor f3 to sector f0. this jump is executed by the final application but not by the emulator. 2.1.1 jump from sector f0 to f3 if the application starts in sector f3 (for example if you are developing an iap bootloader), a line of code has to be added in sector f0 to jump to the reset vector. this way the emulator will jump to the beginning of the application, executing just one more instruction than the chip.
5/10 st92f150 and st92f120 problem resolution guidelines example, resetf0.spp : ;use this file only when emulating the code #include "config.spp" #include "define.h" programming_model .section .init ;emulator reset vector redirection .word __resetf0 .org 0x06 ;external watchdog routine vector .word 0xffff .org 0x0a .proc __resetf0 __resetf0: jps seg(__reset), sof(__reset) .endproc __resetf0 this file must be defined in the makefile.mak as a spp source file. example : # give here the name of the c/spp/asm source files used in the appli- cation c_src = main.c spp_src = resetf0.spp asm_src = # give here the name of the stratup files used in the application startup_src = crtbegin.spp crtend.spp
6/10 st92f150 and st92f120 problem resolution guidelines the init section of the resetf0.spp file must be loaded in sector f0 in the scriptfile.ld. example : memory { flash0 : origin = 0x000000, length = 64k, mmu = idpr0 flash1 : origin = 0x010000, length = 48k, mmu = idpr1 flash2 : origin = 0x01c000, length = 8k flash3 : origin = 0x01e000, length = 8k, mmu = idpr2 ram : origin = 0x200000, length = 4k, mmu = idpr3 eeprom : origin = 0x220000, length = 1k, regfile (t) : origin = 0x00, length = 0xb0 /* groups 0 to 0x0b */ } sections { .initf0 : { resetf0.spp(.init) } > flash0 .init : { *(.init) } > flash3 .text : { *(.text) } > flash3 .fini : { *(.fini) } > flash3 remark : if the compact memory model is selected, the compiler will generate the following warning message : appli.u(.init): warning: code section not in the same segment as section `.initf0' appli.u(.text): warning: code section not in the same segment as section `.initf0' it is normal, because in the compact memory model, all the application code must be located in the same 64kbyte segment. but, since the added jump is the first instruction executed and the only one in segment f0, there is no impact on the execution of the application.
7/10 st92f150 and st92f120 problem resolution guidelines 2.1.2 jump from sector f3 to f0 if the application does not start in sector f3 (8kbyte) but in f0 (64kbyte) you must add a jump from sector f3 to sector f0. this jump will not be executed by the emulator. example, resetf3.spp : #include "config.spp" programming_model .section .init .word resetf3 resetf3: jps seg(__reset), sof(__reset) this file must be defined in the makefile.mak as a spp source file. example : # give here the name of the c/spp/asm source files used in the appli- cation c_src = main.c spp_src = resetf3.spp asm_src = # give here the name of the stratup files used in the application startup_src = crtbegin.spp crtend.spp the init section of the resetf3.spp file must be loaded in sector f3 in the scriptfile.ld.
8/10 st92f150 and st92f120 problem resolution guidelines example : memory { flash0 : origin = 0x000000, length = 64k, mmu = idpr0 flash1 : origin = 0x010000, length = 48k, mmu = idpr1 flash2 : origin = 0x01c000, length = 8k flash3 : origin = 0x01e000, length = 8k, mmu = idpr2 ram : origin = 0x200000, length = 4k, mmu = idpr3 eeprom : origin = 0x220000, length = 1k, regfile (t) : origin = 0x00, length = 0xb0 /* groups 0 to 0x0b */ } sections { .initf3 : { resetf3.spp(.init) } > flash3 .init : { *(.init) } > flash0 .text : { *(.text) } > flash0 .fini : { *(.fini) } > flash0 remark : if the compact memory model is selected, the compiler will generate the following warning message : appli.u(.init): warning: code section not in the same segment as section `.initf3' appli.u(.text): warning: code section not in the same segment as section `.initf3' it is normal, because in the compact memory model, all the application code must be located in the same 64kbyte segment. but, since the added jump is the first instruction executed and the only one in segment f3, there is no impact on the execution of the application.
9/10 st92f150 and st92f120 problem resolution guidelines 2.2 problem description we are using st92f120 128kbyte flash devices from several lots. the application works fine with the oldest ones but is not executed at all with the new ones. the microcontroller seems to be halted. 2.3 analysis before tracecode v99080027 (mid-2000), the reset vector of the st92f120 128kbyte flash device was located in 0x000000h, which was not suitable for in application programming needs. it has been changed and the reset vector is now located in 0x01e000h. 2.4 resolution add a jump from sector f3 to sector f0.
10/10 st92f150 and st92f120 problem resolution guidelines "the present note which is for guidance only aims at providing customers with information regarding their products in order for them to save time. as a result, stmicroelectronics shall not be held liable for any direct, indirect or consequential damages with respect to any claims arising from the content of such a note and/or the use made by customers of the information contained herein in connexion with their products." information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the co nsequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publicati on are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics prod ucts are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroele ctronics. the st logo is a registered trademark of stmicroelectronics ? 2001 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - canada - china - finland - france - germany - hong kong - india - israel - italy - japan malaysia - malta - morocco - singapore - spain - sweden - switzerland - united kingdom - u.s.a. http://www.st.com


▲Up To Search▲   

 
Price & Availability of AN1474

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X