Hi, Modifications in CDL file is in attach patch file (hal_kinetis.diff). I send you too a diff between my ecc file and default template (ecos_dflt_sram.diff) without SRAM modifications. You can test it with your hello world example. I don't need exception explanation until SRAM hello world example works properly. Code hangs in hal_reset_vsr (line 187), exactly in SVC routine hal_switch_state_vsr (line 141). Regards. ---------------------------------------- > Date: Fri, 6 May 2011 09:35:47 +0200 > From: ili...@siva.com.mk > To: ecos-discuss@ecos.sourceware.org > Subject: Re: [ECOS] Kinetis TWR-K60N512-KIT questions > > On 05.05.2011 16:30, jjp jjp wrote: > > Hi, > > I test unified RAM configuration and it works for me with some > > modifications. > > -. Replace SRAM by RAM hal_cortexm_kinetis_twr_k60n512.cdl to disable > > execution of SWI in > > Might help if I see your modified CDL (or diff). Have you tried with > original files? > > > hal_reset_vsr (line 187). Execution of this part reset tower and flash code > > runs again. > > Other than selecting SRAM what is your configuration? Can you send me > the .ecc ? > What gnutools are you using? > > > -. Lookup /dev/ser3 and make cyg_io_write instead of printf. Code with > > printf reset tower and > > flash code runs again. > > > > I also try to use cortexm exception support but it fails. > > I install an exception handler with cyg_exception_set_handler for > > CYGNUM_HAL_VECTOR_SERVICE > > (vector 11 -> SVCall). I make a SWI call an I expect it to modify execution > > flow to call my exception handler. > > SWI calls hal_default_svc_vsr and R3 get a dummy value not a function > > address value. > > I would need more information. Can you send some code snippet? > > > Why software interrupt doesn't call hal_default_exception_vsr? > > Regards. > > > > ---------------------------------------- > >> Date: Thu, 5 May 2011 00:36:00 +0200 > >> From: ili...@siva.com.mk > >> To: ecos-discuss@ecos.sourceware.org > >> Subject: Re: [ECOS] Kinetis TWR-K60N512-KIT questions > >> > >> On 04.05.2011 12:46, jjp jjp wrote: > >>> Hi, > >>> It works with ecos toolchain and gcc-4.6 with -mcpu=cortex-m4! > >>> Great job Ilija. > >> Thanks for good words. > >> I am testing some integer DFT code with gcc-4.6 / Cortex-M4. Shows > >> performance improvement over M3 code even for plain C code. > >> > >>> My miktake was to put optimization flag to -O0 in global flags. > >>> I will test your RAM configuration and give you feedbacks. > >> I appreciate. > >> > >> Regards > >> Ilija > >> > >> > >> -- > >> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > >> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > >> > > > > > > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss >
--- ecos_dflt.ecc 2011-05-11 10:42:10.000000000 +0200 +++ ecos.ecc 2011-05-11 10:08:07.000000000 +0200 @@ -116,18 +116,17 @@ # cdl_option CYGBLD_GLOBAL_CFLAGS { # Flavor: data - # No user value, uncomment the following line to provide one. - # user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" - # value_source default + user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + # value_source user # Default value: CYGBLD_GLOBAL_WARNFLAGS . "-mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # CYGBLD_GLOBAL_WARNFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings " # --> "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # The following properties are affected by this value - # option CYGBLD_INFRA_CFLAGS_PIPE - # Requires: is_substr(CYGBLD_GLOBAL_CFLAGS, " -pipe") # option CYGBLD_INFRA_CFLAGS_WARNINGS_AS_ERRORS # Requires: is_substr(CYGBLD_GLOBAL_CFLAGS, " -Werror") + # option CYGBLD_INFRA_CFLAGS_PIPE + # Requires: is_substr(CYGBLD_GLOBAL_CFLAGS, " -pipe") # package CYGPKG_HAL_CORTEXM # Requires: CYGHWR_HAL_CORTEXM_BIGENDIAN implies # is_substr(CYGBLD_GLOBAL_CFLAGS, " -mbig-endian ") && @@ -144,9 +143,8 @@ # cdl_option CYGBLD_GLOBAL_LDFLAGS { # Flavor: data - # No user value, uncomment the following line to provide one. - # user_value "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" - # value_source default + user_value "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" + # value_source user # Default value: "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" # The following properties are affected by this value @@ -160,6 +158,20 @@ # !is_substr(CYGBLD_GLOBAL_LDFLAGS, " -mbig-endian ") }; +# Standard compiler warning flags +# This option specifies the default warning-related compiler flags used +# on all eCos platforms. +# +cdl_option CYGBLD_GLOBAL_WARNFLAGS { + # Calculated value: "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings " + # Flavor: data + # Current_value: -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings + + # The following properties are affected by this value + # option CYGBLD_GLOBAL_CFLAGS + # DefaultValue: CYGBLD_GLOBAL_WARNFLAGS . "-mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" +}; + # Build common GDB stub ROM image # Unless a target board has specific requirements to the # stub implementation, it can use a simple common stub. @@ -181,20 +193,6 @@ # ActiveIf: CYGBLD_BUILD_COMMON_GDB_STUBS }; -# Standard compiler warning flags -# This option specifies the default warning-related compiler flags used -# on all eCos platforms. -# -cdl_option CYGBLD_GLOBAL_WARNFLAGS { - # Calculated value: "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings " - # Flavor: data - # Current_value: -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings - - # The following properties are affected by this value - # option CYGBLD_GLOBAL_CFLAGS - # DefaultValue: CYGBLD_GLOBAL_WARNFLAGS . "-mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" -}; - # < # < # eCos HAL @@ -340,7 +338,7 @@ # user_value 1 # value_source default # Default value: CYG_HAL_STARTUP != "RAM" - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # --> 1 # The following properties are affected by this value @@ -389,7 +387,7 @@ # value_source default # Default value: (CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS || CYG_HAL_STARTUP == "RAM") ? 1 : 0 # CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS == 0 - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # --> 0 # The following properties are affected by this value @@ -1062,7 +1060,7 @@ # user_value 1 # value_source default # Default value: CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # CYGSEM_HAL_USE_ROM_MONITOR == 0 # --> 1 # Requires: CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_RESET @@ -1273,9 +1271,9 @@ # value_source default # Default value: 0 # Requires: CYG_HAL_STARTUP == "ROM" || CYG_HAL_STARTUP == "JTAG" - # CYG_HAL_STARTUP == ROM - # CYG_HAL_STARTUP == ROM - # --> 1 + # CYG_HAL_STARTUP == SRAM + # CYG_HAL_STARTUP == SRAM + # --> 0 # Requires: CYGDBG_HAL_CRCTABLE_LOCATION == "ROM" # CYGDBG_HAL_CRCTABLE_LOCATION == RAM # --> 0 @@ -1304,22 +1302,22 @@ # user_value 0 0 # value_source default # Default value: CYG_HAL_STARTUP == "RAM" ? "GDB_stubs" : 0 - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # --> 0 0 # Legal values: "Generic" "GDB_stubs" # Requires: CYG_HAL_STARTUP == "RAM" - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # --> 0 # The following properties are affected by this value - # option CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE - # DefaultValue: CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR - # option CYGSEM_HAL_VIRTUAL_VECTOR_INHERIT_CONSOLE - # ActiveIf: CYGSEM_HAL_USE_ROM_MONITOR - # option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT - # ActiveIf: CYGSEM_HAL_USE_ROM_MONITOR || CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS # option CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS # Requires: ! CYGSEM_HAL_USE_ROM_MONITOR + # option CYGDBG_HAL_DEBUG_GDB_CTRLC_SUPPORT + # ActiveIf: CYGSEM_HAL_USE_ROM_MONITOR || CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS + # option CYGSEM_HAL_VIRTUAL_VECTOR_INHERIT_CONSOLE + # ActiveIf: CYGSEM_HAL_USE_ROM_MONITOR + # option CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE + # DefaultValue: CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR }; # < @@ -1464,14 +1462,14 @@ # is_substr(CYGBLD_GLOBAL_CFLAGS, " -mbig-endian ") && # is_substr(CYGBLD_GLOBAL_LDFLAGS, " -mbig-endian ") # CYGHWR_HAL_CORTEXM_BIGENDIAN == 0 - # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # CYGBLD_GLOBAL_LDFLAGS == "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" # --> 1 # Requires: !CYGHWR_HAL_CORTEXM_BIGENDIAN implies # !is_substr(CYGBLD_GLOBAL_CFLAGS, " -mbig-endian ") && # !is_substr(CYGBLD_GLOBAL_LDFLAGS, " -mbig-endian ") # CYGHWR_HAL_CORTEXM_BIGENDIAN == 0 - # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # CYGBLD_GLOBAL_LDFLAGS == "-mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-static -Wl,-n -g -nostdlib" # --> 1 @@ -2068,17 +2066,18 @@ # functions in this area. # cdl_option CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION { + # This option is not active # ActiveIf constraint: CYG_HAL_STARTUP == "ROM" - # CYG_HAL_STARTUP == ROM - # --> 1 + # CYG_HAL_STARTUP == SRAM + # --> 0 # Flavor: bool # No user value, uncomment the following line to provide one. - # user_value 1 + # user_value 0 # value_source default # Default value: CYG_HAL_STARTUP == "ROM" - # CYG_HAL_STARTUP == ROM - # --> 1 + # CYG_HAL_STARTUP == SRAM + # --> 0 # The following properties are affected by this value # option CYGOPT_HAL_KINETIS_DIAG_IN_MISC_FLASH_SECTION @@ -2091,9 +2090,10 @@ # functions may be placed as well. # cdl_option CYGOPT_HAL_KINETIS_DIAG_IN_MISC_FLASH_SECTION { + # This option is not active # ActiveIf constraint: CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION - # CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION == 1 - # --> 1 + # CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION == 0 + # --> 0 # Flavor: bool # No user value, uncomment the following line to provide one. @@ -4077,9 +4077,8 @@ # cdl_component CYG_HAL_STARTUP { # Flavor: data - # No user value, uncomment the following line to provide one. - # user_value ROM - # value_source default + user_value SRAM + # value_source user # Default value: ROM # Legal values: "ROM" "SRAM" @@ -4106,12 +4105,12 @@ # Requires: CYG_HAL_STARTUP == "RAM" # component CYGBLD_HAL_CORTEXM_TWR_MK60N512_GDB_STUBS # Requires: CYG_HAL_STARTUP == "ROM" - # option CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE - # DefaultValue: CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR - # component CYGDBG_HAL_DIAG_TO_DEBUG_CHAN - # DefaultValue: (CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS || CYG_HAL_STARTUP == "RAM") ? 1 : 0 # option CYGSEM_HAL_INSTALL_MMU_TABLES # DefaultValue: CYG_HAL_STARTUP != "RAM" + # component CYGDBG_HAL_DIAG_TO_DEBUG_CHAN + # DefaultValue: (CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS || CYG_HAL_STARTUP == "RAM") ? 1 : 0 + # option CYGSEM_HAL_VIRTUAL_VECTOR_INIT_WHOLE_TABLE + # DefaultValue: CYG_HAL_STARTUP != "RAM" || !CYGSEM_HAL_USE_ROM_MONITOR # option CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION # DefaultValue: CYG_HAL_STARTUP == "ROM" # option CYGOPT_HAL_KINETIS_MISC_FLASH_SECTION @@ -4128,12 +4127,12 @@ # . CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT . "_rom" : # (CYG_HAL_STARTUP == "SRAM") ? "kinetis_" # . CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT . "_sram" : "undefined" - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT == 512n128 - # CYG_HAL_STARTUP == ROM + # CYG_HAL_STARTUP == SRAM # CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT == 512n128 # Flavor: data - # Current_value: kinetis_512n128_rom + # Current_value: kinetis_512n128_sram # The following properties are affected by this value # option CYGHWR_MEMORY_LAYOUT_LDI @@ -4147,18 +4146,18 @@ # cdl_option CYGHWR_MEMORY_LAYOUT_LDI { # Calculated value: "<pkgconf/mlt_" . CYGHWR_MEMORY_LAYOUT . ".ldi>" - # CYGHWR_MEMORY_LAYOUT == kinetis_512n128_rom + # CYGHWR_MEMORY_LAYOUT == kinetis_512n128_sram # Flavor: data - # Current_value: <pkgconf/mlt_kinetis_512n128_rom.ldi> + # Current_value: <pkgconf/mlt_kinetis_512n128_sram.ldi> }; # Memory layout header file # cdl_option CYGHWR_MEMORY_LAYOUT_H { # Calculated value: "<pkgconf/mlt_" . CYGHWR_MEMORY_LAYOUT . ".h>" - # CYGHWR_MEMORY_LAYOUT == kinetis_512n128_rom + # CYGHWR_MEMORY_LAYOUT == kinetis_512n128_sram # Flavor: data - # Current_value: <pkgconf/mlt_kinetis_512n128_rom.h> + # Current_value: <pkgconf/mlt_kinetis_512n128_sram.h> }; # < @@ -4261,8 +4260,8 @@ # Flavor: bool # Current value: 1 # Requires: CYG_HAL_STARTUP == "ROM" - # CYG_HAL_STARTUP == ROM - # --> 1 + # CYG_HAL_STARTUP == SRAM + # --> 0 }; # < @@ -6861,7 +6860,7 @@ # value_source default # Default value: 0 # Requires: is_substr(CYGBLD_GLOBAL_CFLAGS, " -Werror") - # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # --> 0 }; @@ -6878,7 +6877,7 @@ # value_source default # Default value: 0 # Requires: is_substr(CYGBLD_GLOBAL_CFLAGS, " -pipe") - # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + # CYGBLD_GLOBAL_CFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mcpu=cortex-m3 -mthumb -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # --> 0 };
diff -Naur hal/cortexm/kinetis_2011-05-11//twr_k60n512/current/cdl/hal_cortexm_kinetis_twr_k60n512.cdl hal/cortexm/kinetis/twr_k60n512/current/cdl/hal_cortexm_kinetis_twr_k60n512.cdl --- hal/cortexm/kinetis_2011-05-11//twr_k60n512/current/cdl/hal_cortexm_kinetis_twr_k60n512.cdl 2011-05-04 16:33:19.000000000 +0200 +++ hal/cortexm/kinetis/twr_k60n512/current/cdl/hal_cortexm_kinetis_twr_k60n512.cdl 2011-05-11 09:45:48.000000000 +0200 @@ -81,7 +81,7 @@ display "Startup type" flavor data default_value {"ROM"} - legal_values {"ROM" "RAM"} + legal_values {"ROM" "SRAM"} no_define define -file system.h CYG_HAL_STARTUP description " @@ -97,7 +97,7 @@ calculated { (CYG_HAL_STARTUP == "ROM" ) ? "kinetis_" . CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT . "_rom" : - (CYG_HAL_STARTUP == "RAM") ? "kinetis_" + (CYG_HAL_STARTUP == "SRAM") ? "kinetis_" . CYGHWR_HAL_CORTEXM_KINETIS_MEM_LAYOUT . "_sram" : "undefined" } description "Combination of 'Startup type' and 'Kinetis member in use' produces the memory layout."
-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss