SiFli Solution is now fully open: a production-ready solution set that accelerates projects from prototype to mass production. Solution Documentation.

SiFli-Wiki SiFli-Wiki SiFli-Wiki
  • User Guide
  • Examples
  • API Documentation
  • About Us
/
  • English
  • 中文

Quick Start

  • Getting Started
  • Product Documentation Summary

Software Development

  • SDK Programming Guide
  • API Documentation
  • Solution Programming Guide
  • FAQ Frequently Asked Questions
    • Development Tool-Related Issues
      • 1 Compilation-Related
      • 2 Jlink
      • 3 KEIL
      • 4 Ozone
      • 5 SiFli
      • 6 Trace32
      • 7 SystemView
      • 8 UART
      • 9 Source Insight-related
    • Chip-Related Issues
      • 1 GPIO-related
      • 2 Timer-Related
      • 3 Interrupt-related
      • 4 Watchdog-Related
      • 5 RTC Related
      • 6 ADC Related
      • 7 I2C-related
      • 8 Low Power-Related
      • 9 PWM
      • 10 System
      • 11 Bluetooth
      • 12 USB-Related
      • 13 UART-Related
      • 14 Dual-core Related
      • 15 I2S-related
      • 13 SPI Related Issues
    • Peripheral Driver Debugging Issues
      • 1 Common LCD Debugging Issues
      • 2 Common Sensor Debugging Issues
      • 3 Common Flash Debugging Issues
      • 4 Common Motor Debugging Issues
    • Software Debugging-Related Issues
      • 1 Log Debugging
      • 2 Online Debugging Method
      • 3 Restoring the Crash Context from a Memory Dump
      • 4 Methods for Saving the Crash Context
  • Application Notes
    • Low-Power Development Guide
    • Application Startup Flow
    • NandFlash_BBM Analysis Guide
    • SF32LB52-DevKit-Core-3p3 Development Board Test Guide
  • Best Practices
    • AI Xiaozhi

Hardware Development

  • SiFli Selection Guide
    • SiFli Chip Model Guide
    • Module Model Guide
  • Chip Hardware Design Guide
    • SF32LB52x Hardware Design Guide
    • SF32LB52X Hardware Design Guide
    • SF32LB56xU Hardware Design Guide
    • SF32LB56xV Hardware Design Guide
    • SF32LB58x Hardware Design Guide
    • SF32 Series UART Automatic Flashing Design
    • SF32LB55x Hardware Design Guide
    • SF32LB52-MOD-1 Module EPD Display Design Guide
  • Development board
    • Development Board Model Guide
    • SF32LB52-DevKit-LCD Development Board User Guide
    • Guide to Making an LCM Adapter Board for SiFli Development Boards
    • Lichuang Huangshan Pi Development Board User Guide
    • SF32LB52-DevKit-Nano Development Board User Guide
    • SF32LB52-DevKit-Core-3p3 Development Board User Guide
    • SF32LB52-OED-6’-EPD Development Board User Guide
    • SF32LB56-DevKit-LCD Development Board User Guide
    • SF32LB58-DevKit-LCD Development Board User Guide
  • Module

Software Tools

  • Software and Hardware Tool Summary
    • Firmware flashing tool Impeller
    • Graphics Conversion Tool
    • Storage debugging tools
      • Flash Chipid and Type Configuration Guide
    • Screen module debugging
      • Screen module introduction
      • Display module framework introduction
      • Directory structure introduction
        • External
        • Built-in
      • Add display module (1) – Add files (copy files)
      • Add display module (2) – Modify the copied driver files
        • Modify the screen driver
        • Modify the screen TP driver
        • Modify the screen backlight driver
      • Add display module (3) – Modify Kconfig/Menuconfig
      • Example operations for adding a display module
        • SF32LB52x-DevKit-LCD example: adding an SPI-LCD (external)
        • Example: adding a QSPI-LCD on 525 (built-in)
        • Example: adding a DPI-LCD on 566 (built-in)
      • FAQ
      • Appendix
        • Display driver callback functions
        • Mapping table between application-layer functions and module driver-layer functions
        • List of adapted display modules
      • LCD frame-rate calculator
    • sftool

Product Introduction

  • About SiFli

On this page

  • 1.1 How to Disassemble an axf File into asm Assembly or a bin File
  • 1.2 Supported Compilers and Versions
  • 1.3 Default LCPU Project Path in the SDK Project
  • 1.4 How to Prevent Unused Global Variables from Being Optimized Out During Compilation
  • 1.5 How to Resolve Compilation Exceptions Caused by Files in the Windows TMP Directory
  • 1.6 Common Compilation Errors
  • 1.7 Method for Forcing a Function to Be Non-Inline
  • 1.8 Method for Compiling Source Files into a Lib
SiFli-Wiki 0 0
Edit this page
  1. SiFli-Wiki /
  2. FAQ Frequently Asked Questions /
  3. Development Tool-Related Issues /
  4. 1 Compilation-Related
View as Markdown Open in ChatGPT Open in Claude

1 Compilation-Related¶

1.1 How to Disassemble an axf File into asm Assembly or a bin File¶

Use Keil’s fromelf.exe tool. First place the axf file to be disassembled in C:\Keil_v5\ARM\ARMCC\bin, Then enter the command in the cmd window:

c:\Keil_v5\ARM\ARMCC\bin\fromelf.exe lcpu_rom.axf --text -c >lcpu_rom.asm
c:\Keil_v5\ARM\ARMCC\bin\fromelf.exe hcpu.axf --text -c >hcpu.asm

Output a bin file from the axf file:

c:\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin --output=./lcpuaxf.bin ./lcpu.axf

1.2 Supported Compilers and Versions¶

Keil, recommended version for armclang --version: alt text
GCC, recommended version: alt text

1.3 Default LCPU Project Path in the SDK Project¶

Please see the screenshot during compilation below, where a copy operation is performed, alt text
The …….\rom_bin\lcpu_general_ble_img\lcpu_lb551.c file is generated by compiling the sdk\example\ble\lcpu_general\project\ec-lb551\ project. The specific code copy operations are in the prebuild.bat batch file before compilation and the postbuild.bat batch file after compilation in the corresponding project directory. alt text
alt text
scons –target=mdk5 will run the following alt text
The prompt when compiling with Keil is as follows: alt text
Batch processing configuration executed before and after keil compilation; see Question: 2.3.1

1.4 How to Prevent Unused Global Variables from Being Optimized Out During Compilation¶

For debugging convenience, some values are placed in a global variable for easier viewing. At this time, unused variables will be optimized out, When defining a variable, you can add the volatile declaration before it so that it will not be optimized out. As follows:

volatile uint32_t flash_dev_id=0xffffffff;

1.5 How to Resolve Compilation Exceptions Caused by Files in the Windows TMP Directory¶

Sometimes, when compiling a project, issues may occur with the generated bootloader, etc. in some Windows PC environments;
In this case, check and confirm whether it is caused by cached files in the Windows temporary directory. You can clean up the contents under the temporary directory. To confirm/display the corresponding directory path, use the command line: “echo %TMP%”. Then delete all files and directories under the corresponding directory.

1.6 Common Compilation Errors¶

(1) The code size of this image (xxx bytes) exceeds the maximum sllowed for this version of the linker. How can this be resolved?
When this error occurs, check whether the Keil license is available.

1.7 Method for Forcing a Function to Be Non-Inline¶

When tracing code in Ozone, after some functions are compiled as inline functions, the code being traced may become assembly language, which makes it inconvenient to trace the code. In this case, you can force the function to be a non-inline function by adding the following declaration before the function: attribute ( (noinline) ) or __NOINLINE

 #define __NOINLINE __attribute__ ( (noinline) )

As follows:

__attribute__ ( (noinline) ) uint8_t _pm_enter_sleep(struct rt_pm *pm)

1.8 Method for Compiling Source Files into a Lib¶

For confidentiality requirements or other reasons, some customers do not want to disclose source code and need to compile a lib library for customers to use. The SDK provides an example for packaging into a Lib: example\misc\generate_lib. For the specific procedure, refer to the README.md document in the project directory.

Previous
Development Tool-Related Issues
Next
2 Jlink

2025, SiFli

Made with Sphinx and Shibuya theme.