STM32 USB Library and Crossworks

Comments

11 comments

  • Avatar
    Michael Johnson

    Sounds like the application is expecting the exception vectors to be mapped into SRAM is this the case?

    0
    Comment actions Permalink
  • Avatar
    Hoisun Ng

    I'm not sure how I can check this?

    Can you give me the procedure for this?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Look at the exception vectors base register value 0xe000ed08. If it's not zero then the application expects the exception vectors to be installed at the address pointed to.

    0
    Comment actions Permalink
  • Avatar
    Hoisun Ng

    This register value is zero, so I guess that isn't the problem.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    What is the application trying to do when it jumps to this address?

    0
    Comment actions Permalink
  • Avatar
    Hoisun Ng

    Now I get an entirely different problem.

    I took these steps:

    -I used Crossworks to download a firmware upgrade binary to the microcontroller.

    -Then I used DfuSe from ST to upgrade the firmware to the virtual com port application I created using Ride.

    -After that I tried to look up the question above, by reloading the Crossworks project to the microcontroller. However this time the firmware did what it was supposed to do and windows recognized a serial port.

    -Then I tried optimizing for size, because the build is too big. But then windows doesn't recognize it so I switch it off again. And now windows still doesn't recognize the USB device.

     

    Now whenever I debug it, it runs without jumping to SRAM. When I pause the debugger it's always at this address: 0x0800026C and the code at that address is DEFAULT_ISR_HANDLER USB_LP_CAN_RX0_IRQHandler.

    I'm really at a loss here, I have no clue why the behaviour changed so much.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Try setting enable unused symbol removal and compile with -O1.

    Try increasing the user stack size.

    0
    Comment actions Permalink
  • Avatar
    Hoisun Ng

    Both options don't work, it still gives me unrecognized USB device.

    It does make the code a lot smaller.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    What do you mean when you say the options don't work?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    You may need to rename the symbol USB_LP_CAN_RX0_IRQHandler in the startup file to match that used in the application.

    0
    Comment actions Permalink
  • Avatar
    Hoisun Ng

    That was indeed the solution, thanks a lot.

    0
    Comment actions Permalink

Please sign in to leave a comment.