본문으로 바로가기

[SES ]Nordic iar 프로젝트 ses로 변경 하기

category 미분류 항목 2023. 1. 6. 11:44

0>  개요

    : nordic sdk 안에 ses 프로젝트는 없고 iar 프로젝트만 있어서 한번 ses 프로젝트를 만들어 봤습니다. 

      샘플 프로젝트로 gzp_desktop_emulator 프로젝트를 사용했습니다.

      마지막에 첨부파일 있으니 다운받으셔서 사용하셔도 됩니다.

 

1>  iar 프로젝트 임포트하기 

 ▶ File --> Import Project...  --> Import IAR EWARM Project 선택

 

  ▶ gzp_desktop_emulator 프로젝트에 ses 프로젝트가 없어서 선택 했습니다.

 

  ▶  Toolchain 관련  default 상태 유지하고 OK 클릭

 

 

 

▶ 위 그림에 나오는 참조 webpage (Embedded Studio Project Importer)는 아래링크 참조하세요.

https://www.segger.com/products/development-tools/embedded-studio/technology/project-importer/

 

External Tool Chains

Building the project with the external tool chain: To build the project with the external tool chain choose a build configuration suffixed External, i.e. Debug External. Embedded Studio builds the project using the external tool chain (e.g. the IAR compile

www.segger.com

 

 

2> 디렉토리 변경하기

  ▶ 기본적으로 iar 아래에 프로젝트가 생성이 되어서 ses 폴더를 만든후 이동했습니다.

 

 

3> 프로젝트 열기

 

 

4> 빌드에러 발생

   : 빌드에러는 .emProject 수정사항 때문에 발생하므로 다른 .emProject 를 참조해 수정해 줍니다. 

Building ‘gzp_desktop_emulator_pca10040’ from solution ‘gzp_desktop_emulator_pca10040’ in configuration ‘nrf52832_xxaa External’
3> Compiling ‘nrf_log_backend_rtt.c’
3> Error starting process /arm/bin/iccarm
4> Compiling ‘nrf_log_backend_serial.c’
4> Error starting process /arm/bin/iccarm
5> Compiling ‘nrf_log_backend_uart.c’
5> Error starting process /arm/bin/iccarm
6> Compiling ‘nrf_log_default_backends.c’
6> Error starting process /arm/bin/iccarm
7> Compiling ‘nrf_log_frontend.c’
7> Error starting process /arm/bin/iccarm
8> Compiling ‘nrf_log_str_formatter.c’
8> Error starting process /arm/bin/iccarm
Build failed

 

5> .emProject 수정사항

  ▶ iar 관련사항 ses 로 변경하기

-      <file file_name="./../../../../../../components/libraries/util/app_error_handler_iar.c" />
+      <file file_name="./../../../../../../components/libraries/util/app_error_handler_gcc.c" />


-      <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_IAR.c" /> 
+      <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />

  ▶ 디렉토리 depth 에 따른 "../"  체킹

 

 

6> .emProject 변경사항.(git diff)

diff --git a/pca10040/ses/gzp_desktop_emulator_pca10040.emProject b/pca10040/ses/gzp_desktop_emulator_pca10040.emProject 
index 4a73152..69fa7df 100644
--- a/pca10040/ses/gzp_desktop_emulator_pca10040.emProject 
+++ b/pca10040/ses/gzp_desktop_emulator_pca10040.emProject 
@@ -6,64 +6,37 @@ 
	   arm_architecture="v7EM"
       arm_core_type="Cortex-M4"
       arm_endian="Little" 
+      arm_fp_abi="Hard" 
       arm_fpu_type="FPv4-SP-D16" 
+      arm_linker_heap_size="8192" 
+      arm_linker_process_stack_size="0" 
+      arm_linker_stack_size="8192" 
+      arm_linker_treat_warnings_as_errors="No" 
       arm_simulator_memory_simulation_parameter="RX 00000000,00080000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD" 
       arm_target_device_name="nRF52832_xxAA"
       arm_target_interface_type="SWD" 
+      c_preprocessor_definitions="BOARD_PCA10040;BSP_SIMPLE;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;GAZELL_PRESENT;NRF52;NRF52832_XXAA;NRF52_PAN_74" 
+      c_user_include_directories=";./../../config;./../../../../../../components;./../../../../../../components/boards;./../../../../../../components/drivers_nrf/nrf_soc_nosd;./../../../../../../components/libraries/atomic;./../../../../../../components/libraries/balloc;./../../../../../../components/libraries/bsp;./../../../../../../components/libraries/delay;./../../../../../../components/libraries/experimental_section_vars;./../../../../../../components/libraries/fifo;./../../../../../../components/libraries/log;./../../../../../../components/libraries/log/src;./../../../../../../components/libraries/memobj;./../../../../../../components/libraries/ringbuf;./../../../../../../components/libraries/strerror;./../../../../../../components/libraries/uart;./../../../../../../components/libraries/util;./../../../../../../components/proprietary_rf/gzll;./../../../../../../components/toolchain/cmsis/include;./../..;./../../../../../../external/fprintf;./../../../../../../external/segger_rtt;./../../../../../../integration/nrfx;./../../../../../../integration/nrfx/legacy;./../../../../../../modules/nrfx;./../../../../../../modules/nrfx/drivers/include;./../../../../../../modules/nrfx/hal;./../../../../../../modules/nrfx/mdk;./../config" debug_start_from_entry_point_symbol="No"
       debug_target_connection="J-Link"
-      linker_section_placements_segments="FLASH1 RX 0x00000000 0x00080000;RAM1 RWX 0x20000000 0x00010000" 
+      gcc_entry_point="Reset_Handler" 
+      macros="CMSIS_CONFIG_TOOL=../../../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar" 
+      debug_register_definition_file="../../../../../../../../modules/nrfx/mdk/nrf52.svd" 
+      debug_start_from_entry_point_symbol="No" 
+      gcc_debugging_level="Level 3"      linker_output_format="hex" 
+      linker_printf_width_precision_supported="Yes" 
+      linker_printf_fmt_level="long" 
+      linker_scanf_fmt_level="long" 
+      linker_section_placement_file="flash_placement.xml" 
+      linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x10000;FLASH_START=0x0;FLASH_SIZE=0x80000;RAM_START=0x20000000;RAM_SIZE=0x10000" 
+ 
+      linker_section_placements_segments="FLASH RX 0x00000000 0x00080000;RAM1 RWX 0x20000000 0x00010000" 
       project_directory=""
       project_type="Executable" />
-    <configuration
-      LIBRARY_IO_TYPE="SEMIHOST (host-formatted)"
-      Name="Internal"
-      arm_compiler_variant="SEGGER"
-      arm_linker_variant="SEGGER"
-      arm_rtl_variant="SEGGER"
-      build_intermediate_directory="Output/$(ProjectName) $(Configuration)/Obj"
-      build_output_directory="Output/$(Configuration)/Exe"
-      build_output_file_name="$(OutDir)/$(ProjectName)$(EXE)"
-      link_linker_script_file="$(StudioDir)/samples/SEGGER_Flash.icf"
-      link_use_linker_script_file="No" />
-    <configuration
-      BUILD_OPTIONS="IAR"
-      Name="External IAR"
-      build_generic_options_file_name="$(StudioDir)/targets/IAR_build_options.xml"
-      project_type="Externally Built Executable" />
-    <folder Name="Internal Files">
-      <configuration Name="Common" build_exclude_from_build="Yes" />
-      <configuration Name="Internal" build_exclude_from_build="No" />
-      <file file_name="$(StudioDir)/samples/Cortex_M_Startup.s" />
-      <file file_name="$(StudioDir)/samples/SEGGER_THUMB_Startup.s" />
-    </folder>
-    <configuration
-      Name="nrf52832_xxaa"
-      arm_architecture="v7EM"
-      arm_core_type="Cortex-M4"
-      arm_endian="Little"
-      arm_fpu_type="FPv4-SP-D16"
-      arm_simulator_memory_simulation_parameter="RX 00000000,00080000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
-      arm_target_device_name="nRF52832_xxAA"
-      build_intermediate_directory="_build"
-      build_output_directory="_build"
-      c_preprocessor_definitions="BOARD_PCA10040;BSP_SIMPLE;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;GAZELL_PRESENT;NRF52;NRF52832_XXAA;NRF52_PAN_74"
-      c_user_include_directories=";./../../config;./../../../../../../components;./../../../../../../components/boards;./../../../../../../components/drivers_nrf/nrf_soc_nosd;./../../../../../../components/libraries/atomic;./../../../../../../components/libraries/balloc;./../../../../../../components/libraries/bsp;./../../../../../../components/libraries/delay;./../../../../../../components/libraries/experimental_section_vars;./../../../../../../components/libraries/fifo;./../../../../../../components/libraries/log;./../../../../../../components/libraries/log/src;./../../../../../../components/libraries/memobj;./../../../../../../components/libraries/ringbuf;./../../../../../../components/libraries/strerror;./../../../../../../components/libraries/uart;./../../../../../../components/libraries/util;./../../../../../../components/proprietary_rf/gzll;./../../../../../../components/toolchain/cmsis/include;./../..;./../../../../../../external/fprintf;./../../../../../../external/segger_rtt;./../../../../../../integration/nrfx;./../../../../../../integration/nrfx/legacy;./../../../../../../modules/nrfx;./../../../../../../modules/nrfx/drivers/include;./../../../../../../modules/nrfx/hal;./../../../../../../modules/nrfx/mdk;./../config"
-      linker_section_placements_segments="FLASH1 RX 0x00000000 0x00080000;RAM1 RWX 0x20000000 0x00010000" />
-    <configuration
-      Name="nrf52832_xxaa External"
-      asm_additional_options="-I./../../config;-I./../../../../../../components;-I./../../../../../../components/boards;-I./../../../../../../components/drivers_nrf/nrf_soc_nosd;-I./../../../../../../components/libraries/atomic;-I./../../../../../../components/libraries/balloc;-I./../../../../../../components/libraries/bsp;-I./../../../../../../components/libraries/delay;-I./../../../../../../components/libraries/experimental_section_vars;-I./../../../../../../components/libraries/fifo;-I./../../../../../../components/libraries/log;-I./../../../../../../components/libraries/log/src;-I./../../../../../../components/libraries/memobj;-I./../../../../../../components/libraries/ringbuf;-I./../../../../../../components/libraries/strerror;-I./../../../../../../components/libraries/uart;-I./../../../../../../components/libraries/util;-I./../../../../../../components/proprietary_rf/gzll;-I./../../../../../../components/toolchain/cmsis/include;-I./../..;-I./../../../../../../external/fprintf;-I./../../../../../../external/segger_rtt;-I./../../../../../../integration/nrfx;-I./../../../../../../integration/nrfx/legacy;-I./../../../../../../modules/nrfx;-I./../../../../../../modules/nrfx/drivers/include;-I./../../../../../../modules/nrfx/hal;-I./../../../../../../modules/nrfx/mdk;-I./../config"
-      build_output_file_name="$(OutDir)/gzp_desktop_emulator_pca10040.out"
-      c_additional_options="--dlib_config &quot;$(IAR_TOOLKIT_DIR)/INC/c/DLib_Config_Full.h&quot;;-e"
-      c_additional_options_backup=";--cpu;Cortex-M4;--fpu;FPv4-SP;--dlib_config &quot;$(IAR_TOOLKIT_DIR)/INC/c/DLib_Config_Full.h&quot;;-e;-Ohs"
-      iar_cl_cpu="Cortex-M4"
-      iar_cl_fpu="FPv4-SP"
-      iar_cl_optimization_level="High (speed)"
-      link_linker_script_file="./../../../gzp_device_iar_nrf52.icf"
-      link_use_linker_script_file="Yes"
-      linker_additional_options=";--redirect;_Printf=_PrintfFull;--redirect;_Scanf=_ScanfFull;--entry;__iar_program_start"
-      linker_post_build_command="&quot;$(IAR_TOOLKIT_DIR)/bin/ielftool&quot; &quot;$(RelTargetPath)&quot; &quot;$(PostLinkOutputFilePath)&quot; --ihex --silent"
-      linker_post_build_command_output_file="_build/gzp_desktop_emulator_pca10040.hex" /> 
+ 
+      <folder Name="Segger Startup Files">
+        <file file_name="$(StudioDir)/source/thumb_crt0.s" /> 
+      </folder> <folder Name="nRF_Log"> 
         <file file_name="./../../../../../../components/libraries/log/src/nrf_log_backend_rtt.c" /> 
         <file file_name="./../../../../../../components/libraries/log/src/nrf_log_backend_serial.c" /> 
@@ -77,7 +50,7 @@ 
       </folder>
     <folder Name="nRF_Libraries"> 
       <file file_name="./../../../../../../components/libraries/util/app_error.c" />
-      <file file_name="./../../../../../../components/libraries/util/app_error_handler_iar.c" /> 
+      <file file_name="./../../../../../../components/libraries/util/app_error_handler_gcc.c" /> 
       <file file_name="./../../../../../../components/libraries/util/app_error_weak.c" /> 
       <file file_name="./../../../../../../components/libraries/fifo/app_fifo.c" /> 
       <file file_name="./../../../../../../components/libraries/uart/app_uart_fifo.c" /> 
@@ -112,31 +85,24 @@ </folder>
     <folder Name="nRF_Segger_RTT"> 
       <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT.c" />
-      <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_IAR.c" /> 
+      <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" /> 
       <file file_name="./../../../../../../external/segger_rtt/SEGGER_RTT_printf.c" /> 
     </folder>
     <folder Name="None">
-      <file file_name="./../../../../../../modules/nrfx/mdk/iar_startup_nrf52.s">
-        <configuration Name="Internal" build_exclude_from_build="Yes" />
-      </file> 
+      <file file_name="./../../../../../../modules/nrfx/mdk/ses_startup_nrf52.s" /> 
+      <file file_name="./../../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" /> 
       <file file_name="./../../../../../../modules/nrfx/mdk/system_nrf52.c" /> 
     </folder>
     <folder Name="nRF_Properitary_RF">
-      <file file_name="./../../../../../../components/proprietary_rf/gzll/iar/gzll_nrf52_iar.a" /> 
+      <file file_name="./../../../../../../components/proprietary_rf/gzll/gcc/gzll_nrf52_sd_resources_gcc.a" /> 
       <file file_name="./../../../../../../components/proprietary_rf/gzll/nrf_gzp.c" /> 
       <file file_name="./../../../../../../components/proprietary_rf/gzll/nrf_gzp_device.c" /> 
     </folder> 
   </project>
-  <configuration
-    Name="External IAR"
-    hidden="Yes"
-    macros="IAR_TOOLKIT_DIR=/arm" />
-  <configuration Name="Internal" hidden="Yes" />
-  <configuration
-    Name="nrf52832_xxaa External"
-    inherited_configurations="External IAR;nrf52832_xxaa" />
-  <configuration
-    Name="nrf52832_xxaa Internal"
-    inherited_configurations="Internal;nrf52832_xxaa" />
-  <configuration Name="nrf52832_xxaa" hidden="Yes" /> 
+  <configuration Name="Release" 
+    c_preprocessor_definitions="NDEBUG" 
+    link_time_optimization="No"    
     gcc_optimization_level="Optimize For Size" /> 
+  <configuration Name="Debug" 
+    c_preprocessor_definitions="DEBUG; DEBUG_NRF" 
+    gcc_optimization_level="None"/> 
</solution>

 

7>  flash_placement.xml 복사하기

    : gzll_ack_payload 안의 파일 수정없이 복사

 

< 기타>

  ▶ 빌드로그

Rebuilding ‘gzp_desktop_emulator_pca10040’ from solution ‘gzp_desktop_emulator_pca10040’ in configuration ‘Debug’
1> Assembling ‘thumb_crt0.s’
2> Compiling ‘nrf_log_backend_rtt.c’
3> Compiling ‘nrf_log_backend_serial.c’
4> Compiling ‘nrf_log_backend_uart.c’
5> Compiling ‘nrf_log_default_backends.c’
6> Compiling ‘nrf_log_frontend.c’
7> Compiling ‘nrf_log_str_formatter.c’
8> Compiling ‘boards.c’
1> Compiling ‘app_error.c’
3> Compiling ‘app_error_handler_gcc.c’
5> Compiling ‘app_error_weak.c’
2> Compiling ‘app_fifo.c’
7> Compiling ‘app_uart_fifo.c’
4> Compiling ‘app_util_platform.c’
6> Compiling ‘nrf_assert.c’
8> Compiling ‘nrf_atomic.c’
1> Compiling ‘nrf_balloc.c’
3> Compiling ‘nrf_fprintf.c’
2> Compiling ‘nrf_fprintf_format.c’
5> Compiling ‘nrf_memobj.c’
6> Compiling ‘nrf_ringbuf.c’
4> Compiling ‘nrf_strerror.c’
7> Compiling ‘retarget.c’
8> Compiling ‘nrf_drv_uart.c’
1> Compiling ‘nrf_ecb.c’
3> Compiling ‘nrf_nvmc.c’
2> Compiling ‘nrfx_atomic.c’
4> Compiling ‘nrfx_prs.c’
5> Compiling ‘nrfx_uart.c’
6> Compiling ‘nrfx_uarte.c’
7> Compiling ‘bsp.c’
1> Compiling ‘keyboard_emulator.c’
8> Compiling ‘main_mouse_keyboard_emulator.c’
3> Compiling ‘mouse_sensor_emulator.c’
2> Compiling ‘SEGGER_RTT.c’
4> Compiling ‘SEGGER_RTT_Syscalls_SES.c’
7> Compiling ‘SEGGER_RTT_printf.c’
5> Assembling ‘ses_startup_nrf52.s’
6> Assembling ‘ses_startup_nrf_common.s’
1> Compiling ‘system_nrf52.c’
4> Compiling ‘nrf_gzp.c’
3> Compiling ‘nrf_gzp_device.c’
1> Generating linker script ‘gzp_desktop_emulator_pca10040.ld’
1> Linking gzp_desktop_emulator_pca10040.elf
Build complete

 

  ▶ 추가된 파일 

      : flash_placement.xml , gzp_desktop_emulator_pca10040.emProject)

ses.zip
0.00MB

 

간단하게  iar 프로젝트를 ses 프로젝트로 임포트 해봤습니다.

 

그럼 수고하세요.

반응형