Upload
others
View
25
Download
3
Embed Size (px)
Citation preview
Migrate from GCC to IAR Embedded Workbench for RISC-V
Felipe Torrezan, IAR Systems
Agenda Reasons to migrate to IAR Embedded Workbench Debug your ELF with C-SPY Migrate to IAR Systems build tools Take advantage of the Project ConverterDebug the converted application with C-SPY
Reasons to migrate toIAR Embedded Workbench
Reasons to migrate
Optimize your application Tune towards speed or size Use smaller and cheaper device Get lower power consumption Industry leading scores (https://www.eembc.org/coremark/)
Reasons to migrate
Access to first-class support Closed support channel without the need to post project related
information in a public forum Large number of tech-notes and videos available IAR Academy offers deep technical training based on the latest version
of the IAR Embedded Workbench
https://www.iar.com/support/#!?tab=resources
Reasons to migrate
Code analysis tools C-STAT static code analysis fully integrated into the IAR Embedded
Workbench for 12 architectures Includes ~250 checks from CWE and CERT plus MISRA-C2004,
MISRA-C2012, MISRA-C++2008 Flexible rule selection and import / export function Can be used from the command line (e.g. with Jenkins)
https://www.iar.com/iar-embedded-workbench/add-ons-and-integrations/c-stat-static-analysis/
Reasons to migrate
Code analysis tools C-RUN runtime code analysis fully integrated into the IAR Embedded
Workbench for Arm and Renesas RX C-RUN checks support:
Array access out of bounds and heap checking Division by zero Integer conversion error, overflow or shift overflow
Optimized test instrumentation minimizes overhead
https://www.iar.com/iar-embedded-workbench/add-ons-and-integrations/runtime-analysis/
Reasons to migrate
Certified build tools for Functional Safety IAR Embedded Workbench – FS edition Simplified validation via the provided FS certificate, safety report and
safety guide Guaranteed support including validated service packs
IndustrialIEC 61508
AutomotiveISO 26262
RailwayEN 50128
MedicalIEC 62304
Arm
Renesas RX
Renesas RL78
Renesas RH850 ** Planed for next release / can be derived from IEC 61508 as “umbrella standard“
Reasons to migrate
State-of-the-art C-SPY debugger Full control of the application in real time Interrupt and power logging RTOS aware debugging Advanced breakpoints Profiling and Code coverage
Time is expensive, when engineers are debugging code
https://www.iar.com/support/#!?tab=resources
Debug your ELF with C-SPY
Debug your ELF file with C-SPY
• ELF object files (*.out, *.elf)• DWARF format for debug information• IAR Embedded Workbench supports:
– Externally built executable– Source level debugging possible
• You can see the advantages of debugging with the C-SPY Debugger
– Without having to rebuild your project!
ELF demo application
• Board:• STM32F429I-DISCO• Startup demo
– GUI and Touchscreen– FreeRTOS– Benchmark demo runs
GUI polygon draw test
ELF demo application
• Use the C-SPY debugger for:– Power measurements– Interrupt logging– Interrupt statistics– RTOS aware debugging– …
ELF demo application
Demonstration
Debug foreign ELF with C-SPY
Migrate to IAR build tools
Reasons to migrate to IAR Embedded Workbench
• Best in class code optimization• Access to first-class support• Code analysis tools• Safety certified build tools• State-of-the-art debugger
– Works with externally built ELF files– Even better with IAR Systems built executables
Migrate to IAR build tools
• Linker supports AEABI compliant ELF object files• Support for 17 GCC attributes• Syntax: __attribute__ ((attribute-list))
__attribute__ ((noinline)) void CopySineWave (uint32_t index){
if (index < 20){
++index;++index;CopySineWave(index);
}}
Take advantage of the IAR project converter
Project Converter
Included in IAR Embedded WorkbenchConverters for projects from TI Code Composer Studio for Arm + MSP430 Keil uVision5 for Arm Renesas HEW and e2 studio for RX ST Atollic TrueSTUDIO
Manual project conversion
• Create an empty project inside the IAR Embedded Workbench• Copy-and-paste the preprocessor include paths from the
previous toolchain to IAR• Set the project and debugger options• Add the source files to your project
– In case, there are assembly files in the project, some re-writing might be required...
RISC-V example from SiFive
• Simple ”Hello World and LED Blinky” application taken from Github
• Runs on the Digilent ArtyA7 board with a SiFive E31 core in it• Step-by-step migration of the project for the IAR Embedded
Workbench for RISC-V
Demonstration
Even more debug info with projects that were built on IAR Systems tools
Summary
Summary
Summary Debug your existing *.ELF with C-SPY Debugger
• No need to rebuild the application, just load it as-it-is• Professional debugger benefits (e.g. RTOS awareness)
Migrate your project to IAR Embedded Workbench• Re-use GCC attributes and use the project converters
Benefit from the features of IAR Systems tools• e.g. built-in static code analysis C-STAT