Haberler:

Foruma Resim Yükleme ve Boyut Sınırlaması ( ! )  https://bit.ly/2GMFb8H

Ana Menü

Keil utanci - Coocox

Başlatan z, 13 Haziran 2014, 04:19:55

strom

Hocam verdiğiniz linkten driver'ı ztn indirmiştim. Keil üzerinden de sorunsuz kullanıyorum.
Em:Blocks Debug/Interface içerisinde şöyle bir ekran var;

Daha sonra "Start Debug" dediğimde bir tane DOS uygulaması çalışıp, hemen kapanıyor ve sonra şu hatayı veriyor;

z

EmBlocks u kurdum.

Sihirbazla basit bir deneme projesi oluşturdum. Keilden nerede ise hiç farkı yok. Derledim. Kodları adım adım çalıştırarak debug da yaptım.

Çok güzel, eski asm dosyalarımda değişiklik yapmam gerekecek bu da sorun değil.

Hızı da çok çok iyi.

Yalnız;

1) Debug menüde registerleri, ram ve rom alanını gözleyebileceğim pencereleri bulamadım.

2) Proje dosyalarından startup haricindekilerin tamamını projeden uzaklaştırdım.  Startup dosyasında SystemInit ve main fonskiyonu çağıran satırları devre dışı bırakıp derlediğimde sürekli olarak main fonksiyonu bulunamadı hatası alıyorum.

Kodların içinde main ile ilgili tek bir satır yok. Bu hatadan nasıl kurtulurum?
Bana e^st de diyebilirsiniz.   www.cncdesigner.com

muhittin_kaplan

#47
coide 90san
emblock 11san.

strom

Bu arada sorunumu çözdüm. ST-LINK'in USB2 portuna bağlamak gerekiyormuş. USB3'te çalışmadı. USB3'te çalıştırmak için bazı driver güncellemeleri filan yapılması gerekiyormuş falan ama uğraşamam onla. Artık bütün portları USB3 olan bir bilgisayar aldığımda bakarım icabına

muhittin_kaplan

gerbay hocam Projeyi (yukardaki linki verdiğim yada https://www.picproje.org/index.php/topic,53745.msg409092.html#msg409092) emblok a import edip derlediğimde
No such file or directory
hatası alıyorum

z

Startup.s içinde start fonksiyonu çağrılıyor. Bunu iptal edince main satırı aramaktan vazgeçti.

Emblocks çok hoşuma gitti. Keilden bile hızlı sanki.

Şimdi bu open source mu? Eğer öyle ise debug aşamasında register isimleri r0, r1, r2 şeklinde küçük harflerle ve kırmızı renkte gösteriliyor. Bunları büyük harf yapıp renklerini değiştirmek benim elimde mi?

Bu değişikliği kim yapar?  (Gelince kebap ısmarlarım.)
Bana e^st de diyebilirsiniz.   www.cncdesigner.com

muhittin_kaplan

hocam
LTO yu keşfetmiştim CoIde de, Em Block ta bulamadım. Kodu Optimize ederken gereksiz yerleri derleme gibi birşeydi.

z

Asm "directive"lerin listesini, nasıl kullanıldığını ve section tanımlamanın nasıl yapıldığını anlatan emblocks'un dokümanlarını arıyorum.

Bana e^st de diyebilirsiniz.   www.cncdesigner.com

Tagli

Bu Em::Blocks'u Linux için de çıkarsalar güzel olurmuş. Aslında temel aldıkları Code::Blocks zaten Linux'ta çalışıyor. İsteseler çok zorlanmazlar diye tahmin ediyorum.
Gökçe Tağlıoğlu

z

Dokümanlar helpin içinde varmış zaten.

F1 ile yardım olsaymış iyi olurmuş.

Keilde yapamadığım için keilden coocox'a yönelmeme neden olan sorunlar emblock da sorunsuz halloldu.

Bana e^st de diyebilirsiniz.   www.cncdesigner.com

muhittin_kaplan


ErsinErce

Alıntı yapılan: Tagli - 13 Haziran 2014, 19:00:20
Bu Em::Blocks'u Linux için de çıkarsalar güzel olurmuş. Aslında temel aldıkları Code::Blocks zaten Linux'ta çalışıyor. İsteseler çok zorlanmazlar diye tahmin ediyorum.

http://www.emblocks.org/web/licensing-main adresinde kodları mevcut linux içinde derlenebilir sanırım

muhittin_kaplan

Yok Bulamıyorum, Bendeki versiyon 1.4 dü 2.0 yükselttim ama COMPILER SELECT penceresini bulamıyorum.
Bare Metal GCC değilde Generic olanı tanımlamak istiyorum.

z

Gözümü korkutan tek şey proje klasörlerinde other içinde 3 dosya var. Birisinin içeriği aşağıda.

Bunu nasıl anlayacağım da gerektiğinde kendime göre uyarlayacağım?

/* ---------------------------------------------------------------------------- */
/*                  Em::Blocks embedded development Support                     */
/* ---------------------------------------------------------------------------- */
/* Copyright (c) 2014, EmBlocks                                                 */
/*                                                                              */
/* All rights reserved.                                                         */
/*                                                                              */
/* Redistribution and use in source and binary forms, with or without           */
/* modification, are permitted provided that the following condition is met:    */
/*                                                                              */
/* - Redistributions of source code must retain the above copyright notice,     */
/* this list of conditions and the disclaimer below.                            */
/*                                                                              */
/* EmBlocks's name may not be used to endorse or promote products derived from  */
/* this software without specific prior written permission.                     */
/*                                                                              */
/* DISCLAIMER:  THIS SOFTWARE IS PROVIDED BY EBLOCKS "AS IS" AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE   */
/* DISCLAIMED. IN NO EVENT SHALL EMBLOCKS BE LIABLE FOR ANY DIRECT, INDIRECT,   */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,  */
/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING         */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                           */
/* ---------------------------------------------------------------------------- */

/*------------------------------------------------------------------------------
 *      Linker script for running in internal FLASH on the STM32F103C8
 *----------------------------------------------------------------------------*/

OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
SEARCH_DIR(.)

/* Memory Spaces Definitions */
MEMORY
{
    ROM  (rx) : ORIGIN = 0x08000000, LENGTH = 64K
    RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}

/* 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
 */


SECTIONS
{
	.text :
	{
		KEEP(*(.isr_vector))
		*(.text*)

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

		/* .ctors */
		*crtbegin.o(.ctors)
		*crtbegin?.o(.ctors)
		*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
		*(SORT(.ctors.*))
		*(.ctors)

		/* .dtors */
 		*crtbegin.o(.dtors)
 		*crtbegin?.o(.dtors)
 		*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
 		*(SORT(.dtors.*))
 		*(.dtors)

		*(.rodata*)

		KEEP(*(.eh_frame*))
	} > ROM

	.ARM.extab :
	{
		*(.ARM.extab* .gnu.linkonce.armextab.*)
	} > ROM

	__exidx_start = .;
	.ARM.exidx :
	{
		*(.ARM.exidx* .gnu.linkonce.armexidx.*)
	} > ROM
	__exidx_end = .;

	__etext = .;
		
	.data : AT (__etext)
	{
		__data_start__ = .;
		*(vtable)
		*(.data*)

		. = ALIGN(4);
		/* preinit data */
		PROVIDE_HIDDEN (__preinit_array_start = .);
		KEEP(*(.preinit_array))
		PROVIDE_HIDDEN (__preinit_array_end = .);

		. = ALIGN(4);
		/* init data */
		PROVIDE_HIDDEN (__init_array_start = .);
		KEEP(*(SORT(.init_array.*)))
		KEEP(*(.init_array))
		PROVIDE_HIDDEN (__init_array_end = .);


		. = ALIGN(4);
		/* finit data */
		PROVIDE_HIDDEN (__fini_array_start = .);
		KEEP(*(SORT(.fini_array.*)))
		KEEP(*(.fini_array))
		PROVIDE_HIDDEN (__fini_array_end = .);

		. = ALIGN(4);
		/* All data end */
		__data_end__ = .;

	} > RAM

	.bss (NOLOAD):
	{
		__bss_start__ = .;
		*(.bss*)
		*(COMMON)
		__bss_end__ = .;
	} > RAM
	
	.heap (NOLOAD):
	{
		__end__ = .;
		end = __end__;
		*(.heap*)
		__HeapLimit = .;
	} > RAM

	/* .stack_dummy section doesn't contains any symbols. It is only
	 * used for linker to calculate size of stack sections, and assign
	 * values to stack symbols later */
	.stack_dummy (NOLOAD):
	{
		*(.stack)
	} > RAM

	/* Set stack top to end of RAM, and stack limit move down by
	 * size of stack_dummy section */
	__StackTop = ORIGIN(RAM) + LENGTH(RAM);
	__StackLimit = __StackTop - SIZEOF(.stack_dummy);
	PROVIDE(__stack = __StackTop);
	
	/* Check if data + heap + stack exceeds RAM limit */
	ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
}
Bana e^st de diyebilirsiniz.   www.cncdesigner.com

AsHeS

#59
Alıntı yapılan: z - 13 Haziran 2014, 19:57:12
Gözümü korkutan tek şey proje klasörlerinde other içinde 3 dosya var. Birisinin içeriği aşağıda.

Bunu nasıl anlayacağım da gerektiğinde kendime göre uyarlayacağım?

Hocam maksadınız dokümansa sizin araştırma konunuz içerisinde Em::Blocks kelimesi geçmese de olur temel noktanız GNU ARM-GCC compiler
https://web.eecs.umich.edu/~prabal/teaching/eecs373-f11/readings/Linker.pdf
STM'in kütüphanelerinde ki Atollic örnekleri size yardımcı olacaktır. O da GCC kullanmaktadır. Örneklerden birinde linker script editlemeyi göstermektedir direkt kopyalıyorum buraya.

/*
*****************************************************************************
**
**  File        : stm32f10x_flash_xl_bank1.ld
**
**  Abstract    : Linker script for loading program in BANK1 of STM32F103ZG flash 
**                memory.
**
**                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 : Atollic TrueSTUDIO(R)
**
**  Distribution: The file is distributed "as is," without any warranty
**                of any kind.
**
**  (c)Copyright Atollic AB.
**  You may use this file as-is or modify it according to the needs of your
**  project. Distribution of this file (unmodified or modified) is not
**  permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the
**  rights to distribute the assembled, compiled & linked contents of this
**  file as part of an application binary file, provided that it is built
**  using the Atollic TrueSTUDIO(R) toolchain.
**
*****************************************************************************
*/

/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20018000;    /* end of 96K RAM */

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

/* Specify the memory areas */
MEMORY
{
  FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 512K
  RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 96K
  MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K
}

/* 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) */
    *(.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   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
    .ARM : {
    __exidx_start = .;
      *(.ARM.exidx*)
      __exidx_end = .;
    } >FLASH

  .ARM.attributes : { *(.ARM.attributes) } > FLASH

  .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 to initialize data */
  _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

  /* Uninitialized data section */
  . = ALIGN(4);
  .bss :
  {
    /* 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

  PROVIDE ( end = _ebss );
  PROVIDE ( _end = _ebss );

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

  /* MEMORY_bank1 section, code must be located here explicitly            */
  /* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
  .memory_b1_text :
  {
    *(.mb1text)        /* .mb1text sections (code) */
    *(.mb1text*)       /* .mb1text* sections (code)  */
    *(.mb1rodata)      /* read-only data (constants) */
    *(.mb1rodata*)
  } >MEMORY_B1

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

Özet:
Linker scriptte ki MEMORY alanına
  ZIOS_RAM_SECTION (rw)  : ORIGIN = 0x20002000, LENGTH = 32
tanımlandıktan sonra
Aşağıya
  .RAMzios : {*(.RAMzios)} > ZIOS_RAM_SECTION
yazın.

Kodda bir dizi yerleştirmek için uint8_t special_array[32] __attribute__((section(".RAMzios")));

Yazdınız mı oldu bitti.