This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Need help writing some Inline Assembler - How to Generate Assembler Listing File

Hi Guys,

Is there a way with the Keil C Compiler to get an *.LST file or some sort of Assembly output from C source input?

I'm still trying to write some code to drive the WS2811 RGB LED Drivers as the WS2812 library kindly posted by Lava here does not seem to drive the WS2811 chips. The library works fine for WS2812 chips (if you user C Optimisation level 0 & 1 and tick the Optimise for Time option) but not the WS2811 chips. The WS2811s seem to be a lot fussier about bit timing whereas the WS2812s don't seem to mind the variations.

So I've been digging around for alternatives and found another library here and I managed to port it from GCC to the Keil _ASM() format, however the compiler insists on inserting some additional assembler that screws up the timing. I think it is a size related thing. So I'd like to rewrite the logic to be a smaller loop to reduce the size of the code and avoid the compiler inserted assembler.

So I need to write some inline assembler to do a similar job but I'd like to start with writing the logic in C and then look at the generated Assembler and tweak it to do what I need.

Any hints, clues, suggestions? I can't see any options in the project properties to do this.

Regards

Alex Shepherd

Parents
  • I can find the "C Compiler Listing" option on the "Listing" tab of the "Options for Target" dialog under the Project menu, however that option is grayed-out. I tried fiddling with other options to see if I could enable it, but I didn't discover a way.

    Below is the version information and I've attached a PNG screen dump of the "Options for Target" dialog for reference.

    Regards

    Alex Shepherd

    IDE-Version:
    µVision V5.0.5.15
    Copyright (C) 2013 ARM Ltd and ARM Germany GmbH. All rights reserved.
    
    License Information:
    Alex Shepherd
    NetValue Ltd
    LIC=----
    
    Tool Version Numbers:
    Toolchain:        MDK-Lite  Version: 5.0.5.0
    Toolchain Path:    C:\Keil\ARM\ARMCC\bin\
    C Compiler:         Armcc.Exe       V5.03.0.76 [Evaluation]
    Assembler:          Armasm.Exe       V5.03.0.76 [Evaluation]
    Linker/Locator:     ArmLink.Exe       V5.03.0.76 [Evaluation]
    Librarian:             ArmAr.Exe       V5.03.0.76 [Evaluation]
    Hex Converter:      FromElf.Exe       V5.03.0.76 [Evaluation]
    CPU DLL:               SARMCM3.DLL       V5.0.5.0
    Dialog DLL:         DARMCM1.DLL       V1.11.00.0
    Target DLL:         Segger\JL2CM3.dll
    Dialog DLL:         TARMCM1.DLL       V1.08.00.0
    

    Keil-Options-For-Target-Listing.png

  • It may seem like this is an option that's limited to the full MDK-ARM suite, and not available for the Lite version. The only option I can think of apart from this, is to use the debugger. I've extended my answer above with a screenshot of this.

    Apart from that, I guess the only options are to either buy a professional license for Keil, or move to a free compiler like gcc.

Reply Children
No Data
Related