25
Migrate from GCC to IAR Embedded Workbench for RISC-V Felipe Torrezan, IAR Systems

Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

  • Upload
    others

  • View
    25

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Migrate from GCC to IAR Embedded Workbench for RISC-V

Felipe Torrezan, IAR Systems

Page 2: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 3: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Reasons to migrate toIAR Embedded Workbench

Page 4: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 5: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 6: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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/

Page 7: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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/

Page 8: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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“

Page 9: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 10: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Debug your ELF with C-SPY

Page 11: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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!

Page 12: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

ELF demo application

• Board:• STM32F429I-DISCO• Startup demo

– GUI and Touchscreen– FreeRTOS– Benchmark demo runs

GUI polygon draw test

Page 13: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

ELF demo application

• Use the C-SPY debugger for:– Power measurements– Interrupt logging– Interrupt statistics– RTOS aware debugging– …

Page 14: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

ELF demo application

Page 15: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Demonstration

Debug foreign ELF with C-SPY

Page 16: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Migrate to IAR build tools

Page 17: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 18: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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);

}}

Page 19: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Take advantage of the IAR project converter

Page 20: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 21: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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...

Page 22: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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

Page 23: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Demonstration

Even more debug info with projects that were built on IAR Systems tools

Page 24: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

Summary

Page 25: Migrate from GCC to IAR Embedded Workbench for RISC-V · Migrate your project to IAR Embedded Workbench • Re-use GCC attributes and use the project converters Benefit from the features

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