Skip to content

Sail51 migration and debugging

Convert the project

  1. Start bin\Sail51-Keil-Converter.exe from the extracted SDK. Select your original Keil .uvproj or .uvprojx file and choose Keil, VS Code, or both outputs. The converter keeps the original project file intact.
  2. Open the generated project. The standard Keil destination is the SAIL51 folder, with firmware and listings under obj. The VS Code configuration builds from sail51.json and writes firmware under build.
  3. Check the imported MCU, memory model, macros, include paths, startup settings, and debugger. Build and compare the memory map with your project’s original layout before programming hardware.

For a new project, run New Sail Keil Project in Sail51 Tools, select the MCU and an empty destination, and build the generated starter source. The SDK includes additional examples under examples when supplied with the package.

Check source and libraries

Sail51 accepts C and supported A51 assembly source. It builds native .o51 objects and .lib51 libraries. A supplier’s .lib works if it contains a Sail51 archive. For legacy Keil OMF51 objects and libraries, obtain a Sail51 build or rebuild from source. During conversion, review any reported replacement of a legacy STC USB library with its corresponding bundled Sail51 archive. The SDK’s user manual documents the shipped library variants and compatibility options.

Start debugging

  • In uVision, select the simulator or the supported driver for your board in the generated project’s Debug settings. Rebuild before starting the session so uVision loads the current OMF51 debug image. Source records point to the project sources. The HEX file is the image for programming the device.
  • In VS Code, open the converted workspace and build the selected target before starting the corresponding Sail51 debug configuration. For supported STC hardware, select USB emulator or COM serial in the Sail51 Debug view. Use the connection settings for your actual board.

If breakpoints point to old code after a build or SDK upgrade, check the selected target and the debug image path. Keep the converted project and set SAIL51_ROOT to the new SDK before restarting the IDE and rebuilding. Sail51 refreshes its cached build data during the build.