Skip to content

Cannot use assembly files in MCS51 platform due to core issue #3917

@maxgerhardt

Description

@maxgerhardt

What kind of issue is this?

  • [X ] PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Windows 10 x64

PlatformIO Version (platformio --version): PlatformIO Core, version 5.2.0a3

Description of problem

Per https://community.platformio.org/t/mcs51-assembler-programming/20410.

When attempting to write an assembler program for a MCS51 device on Windows by creating a src/blink.s file, the following error occurrs

Building in release mode
sdcc -DF_CPU=11059200 -DHEAP_SIZE=64 -DPLATFORMIO=50200 -Iinclude -Isrc -c -o .pio\build\stc15f204ea\src\blinky.rel src\blinky.s
at 1: error 119: don't know what to do with file 'src\blinky.s'. file extension unsupported
SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.4 #10766 (MINGW64)

Suddenly it wants to use sdcc, the C compiler, for the .s file, but in the special case of SDCC, it does not know how to handle assembly files.

The platform code

https://github.com/platformio/platform-intel_mcs51/blob/c52ea3a706e540df65bdc6a0caf64f1eefeb8ac9/builder/main.py#L56-L60

sets the correct AS="sdas8051" directive, however the code in

# fix ASM handling under non case-sensitive OS
if not Util.case_sensitive_suffixes(".s", ".S"):
env.Replace(AS="$CC", ASCOM="$ASPPCOM")

overwrites the assembler on non-case-sensitive operating systems to SDCC, thus causing the issue.

Steps to Reproduce

  1. Create a new project for the stc15f204ea board
  2. Add a blink.s file with empty content
  3. Hit "Build"

Actual Results

sdcc -DF_CPU=11059200 -DHEAP_SIZE=64 -DPLATFORMIO=50200 -Iinclude -Isrc -c -o .pio\build\stc15f204ea\src\blinky.rel src\blinky.s
at 1: error 119: don't know what to do with file 'src\blinky.s'. file extension unsupported

Expected Results

It uses sdas8051 correctly, as it actually does on Llinux.

Building in release mode
sdas8051 -o .pio/build/stc15f204ea/src/blinky.rel src/blinky.s
[..]

(note: the assembler flags are still wrong per linked issue, but that's a different issue)

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:stc15f204ea]
platform = intel_mcs51
board = stc15f204ea

Source file to reproduce issue:

Additional info

On Linux systems this issue does not occur

Building in release mode
sdas8051 -o .pio/build/stc15f204ea/src/blinky.rel src/blinky.s

But final linking fails due to multiple other issues which will be filed separately in the MCS51 platform (missing -l assembler flag, etc.).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions