블로그 이미지
안녕1999

카테고리

전체 (3067)
자바스크립트 (20)
안드로이드 (14)
WebGL (4)
변비 (17)
정치,경제 (35)
C언어,ARM (162)
컴퓨터(PC, Note Book, 윈.. (41)
전자회로, PCB (27)
유머,안웃긴,GIF,동영상 (118)
국부론60 (71)
모듈(PCB) (3)
건강 (2)
FreeCAD (25)
PADS (43)
퇴직,퇴사,구직,취업 활동 (3)
C# (86)
엑셀 (8)
워드 (0)
LabView (6)
레고 (30)
FPGA (0)
Total
Today
Yesterday

달력

« » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글

STM32 칩중에는 프로그램을 UART로 다운로드할 수 있는 기능이 있는 칩이 있다.

이를 활용하면, RS-232케이블만 있다면, 프로그램 다운로딩이 가능하다.


개발할때 JTAG나 ISP장비가 없어도 된다.

제품이 현장설치된 경우, 고객이 직접 다운로딩도 가능하여, 유지보수에도 효과적이다.


STM32 Flash loader demonstrator

=========================================

다운로드 프로그램 : http://www.st.com/en/development-tools/flasher-stm32.html

가입(로그인)이 필요하다.


 Download Databrief 

USART1 (PA9/PA10)로 RS-232 통신이 되도록, 장비를 구성해 놓아야 한다.


HEX파일 다운로드 방법

===============================

1) PC에서 다운로드 프로그램을 실행하고,

2) 장비에서 다운로드 스위치 ON

3) 장비 리셋

4) PC에서 다운로드 진행

5) 장비에서 다운로드 스위치 OFF

6) 장비 리셋


언제나 그렇듯이, 데이터쉬트의 말은 반은 맞고, 반은 알기 어렵다.

아래 테이블을 보고, 2번째항목이, 프로그램 다운로드 모드라는걸 알기는 쉽지 않다.

아래는 Reference manual에 나와있는 내용이다. (데이터쉬트가 아니다.)

USART protocol used in the STM32 bootloader 

.

Posted by 안녕1999
, |

AN3968 Application note

STM32F407/STM32F417 in-application programming (IAP) over Ethernet


Posted by 안녕1999
, |

In-Application Programming (IAP)


부트로더 개념.

PC에서 프로그램을 다운로드 및 실행할 수 있다.



벡터 테이블이 2개인것에 주목.

jump (unconditional branching)명령으로 2번째 프로그램(윗쪽, 사용자 프로그램)을 실행




AN3965 

STM32F40x/STM32F41x in-application programming using the USART


AN4657

STM32 in-application programming (IAP) using the USART 


RM0090  Reference manual

STM32F405/415, STM32F407/417, STM32F427/437 and STM32F429/439 advanced ARM®-based 32-bit MCUs


RM0090






STM32 - FLASH write




검색결과

IAP (In-Application Programming), internal flash erase/write | mbed

https://developer.mbed.org/.../iap-in-application-programming-in...
이 페이지 번역하기
2015. 7. 3. - Sample code for how to erase/write LPC1768, LPC11U24, LPC1114, LPC812 and LPC824 internal flash memory. This program uses IAP call ...

In-Application Programming (IAP) Code Example | www.LPCware.com

https://www.lpcware.com/.../application-programming-iap-code-e...
이 페이지 번역하기
2012. 9. 27. - For those in need of IAP demo code / example code, here's simple code ... Command codes for IAP ... Prepare flash sector(s) for erase / writing

problem with IAP-based internal flash programming. | www.LPCware ...

https://www.lpcware.com/.../problem-iap-based-internal-flash-pro...
이 페이지 번역하기
2013. 6. 26. - 댓글 3 - ‎작성자 2
I'm working with "SimpleCortex" board, and have been stumbling on an issue with flashprogramming using the IAP functions.

IAP flash programming - put program to RAM - Keil

www.keil.com/forum/.../iap-flash-programming-put-program-to-...
이 페이지 번역하기
2010. 11. 9. - 댓글 10 - ‎작성자 3
I have developed C code for programming flash using IAP, and I cameto point when I can successful programming sectors 1 to 17 of ...
게시물 5개
2013년 7월 7일
게시물 5개
2013년 1월 7일
게시물 4개
2007년 11월 27일

[PDF]AN3965 - STMicroelectronics

www.st.com/resource/en/application_note/dm00036049.pdf
이 페이지 번역하기
2011. 10. 12. - The STM32F4xx microcontroller can run user-specific firmware to perform IAP of the microcontroller-embedded Flash memory. This feature ...

[PDF]STM32 in-application programming (IAP) using the USART

www.st.com/resource/en/application_note/dm00161366.pdf
이 페이지 번역하기
2015. 4. 27. - An STM32 microcontroller can run user-specific firmware to perform IAP of the Flashmemory embedded in the microcontroller. This feature can ...

flash programming problem - Simplecortex

www.brc-electronics.nl/.../565-flash-programming-problem?...0
이 페이지 번역하기
2013. 6. 25. - I'm trying to use the IAP (in-application-programming) commands to write to the internal flash on the LPC1769. Generally speaking things seem ...

rfLPC: Flash memory In-Application Programming (IAP) - GitHub Pages

hauspie.github.io/rflpc/doc/group__iap.html
이 페이지 번역하기
Flash memory sector-address mapping. More... int, rflpc_iap_get_sector_from_address (const void *address). Flash memory address-sector mapping. More.

microcontroller - Writing to and reading data from Flash using IAP ...

electronics.stackexchange.com/.../writing-to-and-reading-data-fro...
이 페이지 번역하기
2015. 5. 6. - Here you can see functions I'm using to store data into Flash, but I'm getting data erased after power reset, so it's still in RAM not in Flash.

[PDF]AN10835 LPC2000 secondary bootloader for code update using IAP

www.nxp.com/documents/application_note/AN10835.pdf
이 페이지 번역하기
2009. 5. 26. - LPC2000, Secondary bootloader, IAP, Code update. Abstract ... chip flash via UART with 1K XMODEM protocol, SD/MMC with file system ...


Posted by 안녕1999
, |

system-reset을 구현하기위해, 와치독타이머를 사용하려고한다.

그러나, 기존 와치독 타이머는 너무 오래걸려서, 중지하고, 시간을 짧게 조절하려고한다.


=> IWDG는 한번 시작하면, 중지할 수 없다고 합니다.(변경 불가인듯)


적당한 시간설정해서 사용해야할듯.

Posted by 안녕1999
, |

/*
*****************************************************************************
**
**  File        : stm32_flash.ld
**
**  Abstract    : Linker script for STM32F207 Device with
**                1MByte FLASH, 128KByte SRAM
**
**                Set heap size, stack size and stack location according
**                to application requirements.
**
**                Set memory bank area and size if external memory is used.
**
**  Target      : STMicroelectronics STM32
**
**  Environment : Eclipse with CDT plugin and GCC compiler from CodeSourcery
**
**			 Author           Date        Comment
**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** 		    T.Kamenicky      24/06/11    Upravil kod stazen z netu
**			T.Kamenicky		 13/10/11	 Predelal na STM32F2
**			T.Kamenicky		 29/11/11    Pridal podporu externi SRAM
**
*****************************************************************************
*/

/* Entry Point */
/* This define entry point for linker, this address is used for CPU too as absolute first function */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack, _estack is end of stack */
_estack = 0x20020000;    /* end of 128K RAM */

/* Generate a link error if heap and stack don't fit into RAM */
/* Heap is zero because we use own malloc implementation. The amount of heap is calculated 
 * from free space after compilation, see last section for RAM area */
_Min_Heap_Size = 0x0;      /* required amount of heap  */

/* This stack is used for main function. If FreeRTOS is used this stack is used by OS itself. */
/* The size of stack for tasks is defined in freertos config file and when creating the task. */
_Min_Stack_Size = 0x600; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
  FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 1022K		  /* This is main program area */
  FACTORY_VAR(rx) :	ORIGIN = 0x080FF800, LENGTH = 2K 		  /* This area is used for factory values, such as MAC address, ID...etc */
  RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 128K        /* This is RAM area */
  FSMC_SRAM (rx)  : ORIGIN = 0x64000000, LENGTH = 2048K       /* This is useful for external memory, like thru FSMC peripheral */
}

/* Library configurations */
GROUP(libgcc.a libc.a libm.a libnosys.a)

/* Linker script to place sections and symbol values. Should be used together
 * with other linker script that defines memory regions FLASH and RAM.
 * It references following symbols, which must be defined in code:
 *   Reset_Handler : Entry of reset handler
 *
 * It defines following symbols, which code can use without definition:
 *   __exidx_start
 *   __exidx_end
 *   __etext
 *   __data_start__
 *   __preinit_array_start
 *   __preinit_array_end
 *   __init_array_start
 *   __init_array_end
 *   __fini_array_start
 *   __fini_array_end
 *   __data_end__
 *   __bss_start__
 *   __bss_end__
 *   __end__
 *   end
 *   __HeapLimit
 *   __StackLimit
 *   __StackTop
 *   __stack
 */
ENTRY(Reset_Handler)

SECTIONS
{
   /* The startup code goes first into FLASH */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >FLASH

  /* The program code and other data goes into FLASH */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */

    KEEP (*(.init))
    KEEP (*(.fini))

     . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >FLASH

  /* .ARM.extab names a section that contains exception unwinding information.  See EHABI for details. */
  /* .ARM.exidx names a section that contains index entries for section unwinding.  See EHABI for details. */
   .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
    .ARM : {
    __exidx_start = .;
      *(.ARM.exidx*)
      __exidx_end = .;
    } >FLASH

  /* Is used for compiler information, which is located only in elf file */
  .ARM.attributes 0 : { *(.ARM.attributes) }

  /* Those sections is used for initializing dynamic objects used in C++ */
 .preinit_array     :
  {
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array*))
    PROVIDE_HIDDEN (__preinit_array_end = .);
  } >FLASH
  .init_array :
  {
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT(.init_array.*)))
    KEEP (*(.init_array*))
    PROVIDE_HIDDEN (__init_array_end = .);
  } >FLASH
  .fini_array :
  {
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(.fini_array*))
    KEEP (*(SORT(.fini_array.*)))
    PROVIDE_HIDDEN (__fini_array_end = .);
  } >FLASH

  /* used by the startup as memory location to initialize data */
  /* from this point the content of flash is copied to ram */
  _sidata = .;

  /* Initialized data sections goes into RAM, load LMA copy after code */
  .data : AT ( _sidata )
  {
    . = ALIGN(4);
    _sdata = .;        /* create a global symbol at data start */
    *(.data)           /* .data sections */
    *(.data*)          /* .data* sections */

    . = ALIGN(4);
    _edata = .;       /* define a global symbol at data end */
  } >RAM

  _SRAM_data = _sidata + _edata - _sdata;

  /* Second part of inicialized section goes into SRAM conected thru FSMC */
  /* FSMC_SRAM section, code must be located here explicitly            */
  /* unsigned long int __attribute__ ((section (".sram_data"))) my_initialized_number = 0xAABBCCDD; */
  .fsmc_sram_data : AT ( _SRAM_data )
  {
  	. = ALIGN(4);
    _iSRAM_data = .;        
    *(.sram_data)      
    *(.sram_data*)
    
    . = ALIGN(4);
    _iSRAM_data_end = .;   
  } >FSMC_SRAM
  
  .fsmc_sram_bss : AT ( _iSRAM_data_end )
  {
    _iSRAM_null_data = .;       
    *(.sram_bss)
    *(.sram_bss*)
    
    . = ALIGN(4);
    _iSRAM_null_data_end = .;
  } >FSMC_SRAM
  
  .fsmc_sram_perma : AT ( _iSRAM_null_data_end )
  {
    _iSRAM_perma_data = .;       
    *(.sram_perma)
    *(.sram_perma*)
    
    . = ALIGN(4);
    _iSRAM_perma_data_end = .;
  } >FSMC_SRAM
  
   /* Uninitialized data section */
  . = ALIGN(4);
  
  .bss : AT ( _edata )
  {
    /* This is used by the startup in order to initialize the .bss secion */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)

    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM
  
  /* Those numbers are used for SRAM init */
  PROVIDE ( _linker_sram_start = _iSRAM_data );
  PROVIDE ( _linker_sram_data_end = _iSRAM_data_end );
  PROVIDE ( _linker_sram_end = _iSRAM_null_data_end );
  PROVIDE ( _linker_sram_inits = _SRAM_data );
  
  /* Those numbers are used for malloc and sbrk functions */
  PROVIDE ( _linker_memory_start = _sdata );
  PROVIDE ( _linker_heap_start = _ebss );
  PROVIDE ( _linker_heap_end = (_estack - _Min_Stack_Size) );
  PROVIDE ( _linker_memory_end = _estack );
  PROVIDE ( _end = _ebss );

   /* User_heap_stack section, used to check that there is enough RAM left */
  ._user_heap_stack : AT ( _linker_heap_end )
  {
    . = ALIGN(4);
    . = . + _Min_Heap_Size;
    . = . + _Min_Stack_Size;
    . = ALIGN(4);
  } >RAM

 /* FLASH memory area for factory default values                          */
  /* Example of usage: extern int foo(void) __attribute__ ((section (".fvtext"))); */
  /* unsigned long int my_factory_number_changed_in_production = 0xAABBCCDD __attribute__ ((section (".fvrodata"))); */ 
  .factory_values :
  {
    . = ALIGN(4);
    *(.fvtext)        /* .fvtext sections (code) */
    *(.fvtext*)       /* .fvtext* sections (code)  */
    *(.fvrodata)      /* read-only data (constants) */
    *(.fvrodata*)
    . = ALIGN(4);
  } >FACTORY_VAR

  /* Remove information from the standard libraries */
  /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
}


Posted by 안녕1999
, |

최근에 달린 댓글

글 보관함