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

Quick Start

  • Getting Started Guide
  • Product Documentation Summary

Software Development

  • SDK Programming Guide
  • API Documentation
  • Solution Programming Guide
  • FAQ Frequently Asked Questions
    • Questions related to development tools
      • 1 Compilation Related
      • 2 Jlink
      • 3 KEIL
      • 4 Ozone
      • 5 SiFli
      • 6 Trace32
      • 7 SystemView
      • 8 Serial Port
      • 9 Source Insight Related
    • Issues concerning chips
      • 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 issue
      • 1 Common Issues in LCD Debugging
      • 2 Common Issues in Sensor Debugging
      • 3 Common Issues in Flash Debugging
      • 4 Common Issues in Motor Debugging
    • Software Debugging Related Issues
      • 1 Log Debugging
      • 2 Online Debugging Methods
      • 3 Dump Memory to Recover Crash Scene
      • 4 Methods for Saving Crash Dump
  • Application Note
    • SF32LB52X Boot and Low Power Process
    • Low Power Development Guide
    • NandFlash_BBM Parsing Guide
  • Best Practices
    • AI XiaoZhi

Hardware Development

  • Sifli Selection Manual
  • Chip Hardware Design Guide
    • SF32LB52x - Hardware Design Guide
    • SF32LB52X - Hardware Design Guide
    • SF32LB56xU - Hardware Design Guide
    • SF32LB56xV - Hardware Design Guide
    • SF32LB58x - Hardware Design Guide
    • SF32LB55x - Hardware Design Guide
  • Development Boards
    • SF32LB52-DevKit-LCD Development Board User Guide
    • Sich Dev Board LCM Adapter Board Guide
    • SF32LB52-DevKit-ULP Development Board User Guide
    • SF32LB52-DevKit-Nano Development Board User Guide
    • SF32LB56-DevKit-LCD Development Board User Guide
    • SF32LB58-DevKit-LCD Development Board User Guide
  • Module

Software Tools

  • Summary of Software and Hardware Tools
    • Firmware Burning Tool Impeller
    • Graphics Conversion Tool
    • Storage Debugging Tools
      • Flash Chipid and Type Configuration Guide
    • Screen Module Debugging
      • Introduction to Screen Modules
      • Screen Module Framework Introduction
      • Directory Structure Introduction
      • Adding Screen Module (1) – Adding Files (Copying Files)
      • Add Screen Module (2) – Modify the Copied Driver File
      • Add Screen Module (3) – Modify Kconfig/Menuconfig
      • Adding Screen Module Operation Examples
      • FAQ
      • Appendix
        • Screen Driver Callback Functions
        • Application Layer vs. Module Driver Layer Function Correspondence Table
        • List of Supported Screen Modules
    • sftool

Product Introduction

  • About SiFli Technologies

On this page

  • 1.1 How to Disassemble axf Files to asm Assembly or bin Files
  • 1.2 Supported Compilers and Versions
  • 1.3 Default Lcpu Project Path in the SDK
  • 1.4 How to Prevent Unused Global Variables from Being Optimized
  • 1.5 How to Resolve Compilation Issues Caused by Windows TMP Directory Files
  • 1.6 Common Compilation Errors
  • 1.7 How to Force a Function to Not Be Inlined
  • 1.8 How to Compile Source Files into a Lib
OpenSiFli/SiFli-Wiki 0 0
Edit this page
  1. SiFli-Wiki /
  2. FAQ Frequently Asked Questions /
  3. Questions related to development tools /
  4. 1 Compilation Related

1 Compilation Related¶

1.1 How to Disassemble axf Files to asm Assembly or bin Files¶

Use the fromelf.exe tool from Keil to place the axf file that needs to be disassembled in C:\Keil_v5\ARM\ARMCC\bin, then enter the following commands 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

To 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: alt text
GCC, recommended version: alt text

1.3 Default Lcpu Project Path in the SDK¶

Please refer to the screenshot during compilation, which shows a copy operation: alt text
The file ..\..\..\rom_bin\lcpu_general_ble_img\lcpu_lb551.c is compiled from the project sdk\example\ble\lcpu_general\project\ec-lb551. The specific code copy operations are performed 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
When compiling with Keil, the following prompt appears: alt text
The batch file configurations for pre- and post-compilation with Keil are detailed in issue 2.3.1.

1.4 How to Prevent Unused Global Variables from Being Optimized¶

To facilitate debugging, certain values are placed in global variables for easy viewing. However, unused variables may be optimized. To prevent this, add the volatile keyword before the variable definition, as follows:

volatile uint32_t flash_dev_id=0xffffffff;

1.5 How to Resolve Compilation Issues Caused by Windows TMP Directory Files¶

Sometimes, when compiling a project, issues may arise with the bootloader or other components on certain Windows PCs. In such cases, check if the issue is due to cache files in the Windows temporary directory. You can clear the contents of the temporary directory by using the command line: “echo %TMP%”, and then delete all files and directories in the corresponding path.

1.6 Common Compilation Errors¶

(1) The code size of this image (xxx bytes) exceeds the maximum allowed for this version of the linker. How to resolve? When this error occurs, check if the Keil license is valid.

1.7 How to Force a Function to Not Be Inlined¶

When tracking code in Ozone, some functions may be inlined, causing the code to be displayed in assembly language, which is not convenient for tracking. To force a function to not be inlined, add the __attribute__ ( (noinline) ) or __NOINLINE declaration before the function:

#define __NOINLINE __attribute__ ( (noinline) )

For example:

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

1.8 How to Compile Source Files into a Lib¶

Some customers may need to keep their source code confidential or for other reasons, and prefer to provide a compiled lib file to their clients. The SDK provides an example for packaging source files into a lib in example\misc\generate_lib. For detailed instructions, refer to the README.md document in the project directory.

Previous
Questions related to development tools
Next
2 Jlink

2025, SiFli

Made with Sphinx and Shibuya theme.