DIY Electronic projects

Full Version: STM32F30x + AC6, stack inicijalizacija
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Zdravo svima,

Pokusavam da podesim linker skript tj konkretno sekciju za inicijalizaciju steka ali izgleda da ne znam kako. Ovo su trenutne i zeljene vrednosti:

Quote:/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x2000A000;    /* end of RAM */ <- Ovo zelim da promenim u 0x2001A000

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;      /* required amount of heap  */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
FLASH (rx)      : ORIGIN = 0x8000000, LENGTH = 256K
RAM (xrw)      : ORIGIN = 0x20000000, LENGTH = 40K <- Ovo zelim da promenim u 0x20010000
CCMRAM (rw)      : ORIGIN = 0x10000000, LENGTH = 8K
}

/* Define output sections */
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) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)

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

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

Pretpostavio sam da Reset_Handler nije dobar i probao sam svasta sa njim (ldr r0/r1/sp, =_estack) ali bezuspesno. 

Quote:Reset_Handler:

/* Copy the data segment initializers from flash to SRAM */
  movs r1, #0
  b LoopCopyDataInit

Kao sto stoji u naslovu koristim AC6 System Workbench i STM32F303VCTx sa StdPeriph FW v1.1.0.
Da li imate neki savet kako ovo da resim?

Hvala,
Ivan
Poz,



 taj kontrolercic ima 48k RAM-a? Glupo, pitanje ali da li imas fizicki memoriju na adresi  0x2001A000?
Izgleda da je to rezervisan deo memorije "0x2000 A000 - 3FFF FFFF Reserved", izvor: http://www.st.com/content/ccc/resource/t...043574.pdf

Btw probao sam i sa KEIL MDK i CubeMXF3.

Nije problem, workaround Smile
Pogledaj ovu temu:
http://www.elitesecurity.org/p3794487

Za pocetak bih ti preporucio da zaobidjes CubeMX, bar dok ne pohvatas sta se stvarno u kontroleru desava, zato sam dao taj bazican primer i prosao kroz neke bitne detalje.