This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

μVision 5 project isn't accepting opcodes

Hi all, I'm trying to run a project. I didn't write it and I'm pretty new to ARM development as well. I'm getting the error "Error: A1163E Unknown Opcode MODULE, expecting opcode of Macro                 MODULE ?startup

I'm getting 4 or 5 of those errors, one for each of the opcodes in the code.

After reading other posts about Error: A1163E , it seems like the issue is usually white spaces and indenting, but I've tried the fixes mentioned. I believe I saw one person who just didn't have all the right libraries? All the libraries should be there to my...admittedly low level of knowledge. Is there anything else I can try? Again, as I didn't actually write the code, I can only make educated assumptions and go by the error messages.

  • This is likely legacy assembler format.

    Open the µVision dialog 'Options for Target', then select the tab 'Asm', and then select 'armclang (Auto Select )' for 'Assembler Option'.

    Does this resolve the issue?

    Regards, Ronan

  • Sadly it didn't help. I've included a code snippet and the exact errors in case that clears anything up that I haven't thought of

    MODULE  ?cstartup
    
            ;; Forward declaration of sections.
    SECTION CSTACK:DATA:NOROOT(3)
    
    SECTION .intvec:CODE:NOROOT(2)
    
            EXTERN  __iar_program_start
            EXTERN  SystemInit
    PUBLIC  __vector_table
    		DATA
    __vector_table
            DCD     sfe(CSTACK)
            DCD     Reset_Handler             ; Reset Handler
    
            DCD     NMI_Handler               ; NMI Handler
            DCD     HardFault_Handler         ; Hard Fault Handler
            DCD     MemManage_Handler         ; MPU Fault Handler
            DCD     BusFault_Handler          ; Bus Fault Handler
            DCD     UsageFault_Handler        ; Usage Fault Handler
            DCD     0                         ; Reserved
            DCD     0                         ; Reserved
            DCD     0                         ; Reserved
            DCD     0                         ; Reserved
            DCD     SVC_Handler               ; SVCall Handler
            DCD     DebugMon_Handler          ; Debug Monitor Handler
            DCD     0                         ; Reserved
            DCD     PendSV_Handler            ; PendSV Handler
            DCD     SysTick_Handler           ; SysTick Handler
    
            ; External Interrupts
            DCD     WWDG_IRQHandler                   ; Window WatchDog
            DCD     PVD_IRQHandler                    ; PVD through EXTI Line detection
            DCD     TAMP_STAMP_IRQHandler             ; Tamper and TimeStamps through the EXTI line
            DCD     RTC_WKUP_IRQHandler               ; RTC Wakeup through the EXTI line
            DCD     FLASH_IRQHandler                  ; FLASH
            DCD     RCC_IRQHandler                    ; RCC
            DCD     EXTI0_IRQHandler                  ; EXTI Line0
            DCD     EXTI1_IRQHandler                  ; EXTI Line1
            DCD     EXTI2_TSC_IRQHandler              ; EXTI Line2 and Touch Sense controller
            DCD     EXTI3_IRQHandler                  ; EXTI Line3
            DCD     EXTI4_IRQHandler                  ; EXTI Line4
            DCD     DMA1_Channel1_IRQHandler          ; DMA1 Channel 1
            DCD     DMA1_Channel2_IRQHandler          ; DMA1 Channel 2
            DCD     DMA1_Channel3_IRQHandler          ; DMA1 Channel 3
            DCD     DMA1_Channel4_IRQHandler          ; DMA1 Channel 4
            DCD     DMA1_Channel5_IRQHandler          ; DMA1 Channel 5
            DCD     DMA1_Channel6_IRQHandler          ; DMA1 Channel 6
            DCD     DMA1_Channel7_IRQHandler          ; DMA1 Channel 7
            DCD     ADC1_2_IRQHandler                 ; ADC1 and ADC2
            DCD     CAN_TX_IRQHandler                 ; CAN TX
            DCD     CAN_RX0_IRQHandler                ; CAN RX0
            DCD     CAN_RX1_IRQHandler                ; CAN RX1
            DCD     CAN_SCE_IRQHandler                ; CAN SCE
            DCD     EXTI9_5_IRQHandler                ; External Line[9:5]s
            DCD     TIM1_BRK_TIM15_IRQHandler         ; TIM1 Break and TIM15
            DCD     TIM1_UP_TIM16_IRQHandler          ; TIM1 Update and TIM16
            DCD     TIM1_TRG_COM_TIM17_IRQHandler     ; TIM1 Trigger and Commutation and TIM17
            DCD     TIM1_CC_IRQHandler                ; TIM1 Capture Compare
            DCD     TIM2_IRQHandler                   ; TIM2
            DCD     TIM3_IRQHandler                   ; TIM3
            DCD     0                                 ; Reserved
            DCD     I2C1_EV_IRQHandler                ; I2C1 Event
            DCD     I2C1_ER_IRQHandler                ; I2C1 Error
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     SPI1_IRQHandler                   ; SPI1
            DCD     0                                 ; Reserved
            DCD     USART1_IRQHandler                 ; USART1
            DCD     USART2_IRQHandler                 ; USART2
            DCD     USART3_IRQHandler                 ; USART3
            DCD     EXTI15_10_IRQHandler              ; External Line[15:10]s
            DCD     RTC_Alarm_IRQHandler              ; RTC Alarm (A and B) through EXTI Line
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     TIM6_DAC1_IRQHandler              ; TIM6 and DAC1 underrun errors
            DCD     TIM7_DAC2_IRQHandler              ; TIM7 and DAC2 underrun errors
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     COMP2_IRQHandler                  ; COMP2
            DCD     COMP4_6_IRQHandler                ; COMP4 and COMP6
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     0                                 ; Reserved
            DCD     FPU_IRQHandler                    ; FPU
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    the errors:

    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 41 (column 9): Error: A1163E: Unknown opcode MODULE , expecting opcode or Macro
       41 00000000         MODULE  ?startup
                           ^
    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 44 (column 9): Error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
       44 00000000         SECTION CSTACK:DATA:NOROOT(3)
                           ^
    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 46 (column 9): Error: A1163E: Unknown opcode SECTION , expecting opcode or Macro
       46 00000000         SECTION .intvec:CODE:NOROOT(2)
                           ^
    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 50 (column 9): Error: A1163E: Unknown opcode PUBLIC , expecting opcode or Macro
       50 00000000         PUBLIC  __vector_table
                           ^
    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 52: Error: A1159E: Label missing from line start
       52 00000000         DATA
    "C:/Users/steph/Documents/Pyreos Ltd/ezPyro API/sPYELIB_V1.0.6/projects/ezPyro_API_demo_prj_flame/RTE/Device/STM32F303K8/STCubeGenerated/MDK-ARM/startup_stm32f303x8.s", line 53: Fatal error: A1355U: A Label was found which was in no AREA
       53 00000000 __vector_table

  • This code is for IAR Embedded Workbench, not MDK.
    https://www.iar.com/products/architectures/arm/iar-embedded-workbench-for-arm/

    Based on the path names, it looks like it is auto-generated code by STCubeMX:
    https://www.st.com/en/development-tools/stm32cubemx.html

    Do you have the STM32 project available? You should re-generate the code for MDK.

  • Oh, okay. That explains why MDK didn't like it I guess. I'll have to see in where in the settings that's specified for the generated code. Hopefully that fixes it. I'll see if I can get that to work. Thanks

  • Okay, it looks like that worked for the dummy project that 'generate code' makes. That ran just fine and added code to my project, but I'm still getting  the same errors and a new one:

    ArmClang: error armasm command failed with exit code 8

    I tried each assembler option in uVision and auto select certainly generated the fewest errors but I still get those code errors for the opcodes and that new one.

  • Have you seen this documentation? I should have referenced it in my previous reply:
    https://www.keil.com/pack/doc/STM32Cube/html/index.html

  • I have, I'll go through it again to see what I missed.