Skip to content

sj608/efm-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EFM Blink project

This repository is my personal project to build a custom build system for EFM MCU family

Build Steps

Install arm-none-eabi tool chain from ARM website. After the installation, move the bin files with prefix arm-none-eabi- to system bin directory or any directory. Then add the path to the bin files to $PATH variable. Make sure to logout and login.

Edit Bin util and arm toolchain directory path for the host platform inside cmake/arm-none-eabi.cmake

set(ARM_TOOLCHAIN_DIR "path/to/binutil/") # set arm toolchain directory path
set(BINUTILS_PATH ${ARM_TOOLCHAIN_DIR}) # set binary utility directory path

Cross-compiling setting is configured by invoking the following cmake command

cmake -B build -D CMAKE_TOOLCHAIN_FILE=cmake/arm-none-eabi.cmake

Included following lines to suppress error regarding compiler configs

SET (CMAKE_C_COMPILER_WORKS 1)
SET (CMAKE_CXX_COMPILER_WORKS 1)

To build

cd build
cmake --build .

Linker Options

-specs options uses spec file specified by the string the spec files are inside the ARM lib folder /usr/local/gcc_arm/ARM/arm-none-eabi/lib

-Map=${PROJECT_NAME}.map this option requires -Wl, in front of it.

The issue regarding re-declaration of type is resolved by downgrading the CMSIS pack from 5-5.9.0 to 4.5.0

JLinkEXE

Programming flow command steps

connect
erase
loadbin /directory/to/binfile ...... /Users/sj/Documents/projects/efm-blink/build/EFM-Blink.bin 0
r  - means reset
g  - means go

GDB debugger

Steps to running debugging environment

  1. open two terminal
  2. Run JLinkGDBServerCL -device EFM32G890F128
  3. On another terminal arm-none-eabi-gdb
    • target remote localhost:portnumber/shown/on/JLinkGDBServerCL
    • load, this programs the target and starts from the reset_handler

Reference

Example github repo 1 is here

Example github repo 2 is here

Good reference is here

CMake Referecnce is here

Adding arm-none-eabi-gcc package to path here

CMake Project Structure is here

GCC-GNU compiler and linker options

Uploading Through J-Link steps here

GDB setup interrupt-blog

GDBGUI browser frontend here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published