platformio / platform-intel_mcs51

Intel MCS-51 (8051): development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/intel_mcs51
Apache License 2.0
56 stars 45 forks source link

Weird behavior around --xram-loc #48

Open mtfurlan opened 1 year ago

mtfurlan commented 1 year ago

I'm trying to compile the code in https://github.com/MatzElectronics/CH559sdccUSBHost If I compile with platformio I it just doesn't behave properly, my usb device just kinda hangs.

If I modify builder/main.py:88 LINKFLAGS to include "--xram-loc", "1536" the flashed code works as expected.

--- 87,94 ----
      CPPDEFINES=["F_CPU=$BOARD_F_CPU", "HEAP_SIZE=" + __getSize("size_heap", env)],
      LINKFLAGS=[
          "-m%s" % board_config.get("build.cpu"),
+         "--xram-loc",
+         "1536",
          "--iram-size",
          __getSize("size_iram", env),
          "--xram-size",

I really have no idea why this might be, but I feel like exposing xram-loc the way we expose xram-size is not the correct solution.