cancel
Showing results for 
Search instead for 
Did you mean: 

Error when I try to load code using external loader

Kwame
Associate II

I am currently trying to program this external memory using the external loader sub-project created when a project is created for the ST32H7R7. I have been able to successfully write the drivers for the external flash and I have also been able to port the driver to the external loader subproject. I debugged the external loader subproject to ensure that the driver is working perfectly. However, when I try to load the application project, I end up with the error seen below. what is this error and how do I fix it?

Screenshot 2024-08-24 at 1.15.23 AM.png

  

3 REPLIES 3
MM..1
Chief II

How size is your elf ?

Kwame
Associate II

The application elf file is 1,551,404 bytes

ayesha099
Visitor

The error you're encountering while trying to load the application project for the ST32H7R7 after programming the external memory via the external loader sub-project likely indicates an issue with the interface between the application and the external loader. Here are some common reasons for such errors and how you can potentially fix them:

Possible Causes and Solutions:

  1. Invalid Memory Address:
    Ensure that the application project is configured to load at the correct memory address. Check the linker script for the application to verify that the start address matches the expected address of the external memory.

  2. Mismatch in Loader and Application Protocols:
    Confirm that the protocol used in the external loader matches what the application expects. Any discrepancies in communication can lead to loading errors.

  3. Incorrect Loader Configuration:
    Double-check the configuration settings of the external loader. Ensure that the appropriate settings for the external memory device (like timing, page size, and specific commands) are correctly defined.

  4. Flash Protection or Lock Bits:
    Some external memory devices have protection mechanisms. Ensure that the memory isn't protected or locked, which can prevent writing or loading new applications. You may need to unlock or disable write protection.

  5. Driver Functionality:
    Even if the driver seems to work well during debugging, re-evaluate its integrity and correctness when called from the external loader. Log any errors during the flash operation to identify issues in writing or erasing memory.

  6. Error Messages:
    Pay close attention to the specific error message you are receiving. It may provide hints about what is going wrong. Common messages might indicate timeouts, unrecognized commands, or write failure.

  7. Memory Initialization:
    Ensure that the external memory is properly initialized before loading the application. This includes setting up any necessary timing or control registers required for the memory to operate correctly.

  8. Hardware Check:
    Verify the hardware connections and configurations to ensure that the external memory is properly connected to the ST32H7R7. Look for issues such as loose connections or incorrect pin configurations.

Debugging Steps:

  • Monitor Communications: Use a logic analyzer or debugger to monitor the signals between the microcontroller and the external memory during the loading process.

  • Test with Minimal Code: Create a minimal application just to test writing to and reading from the external memory to isolate the error and confirm the loader's functionality.

  • Documentation Review: Refer to the ST technical documentation or errata for known issues with the ST32H7R7 and the external memory being used. This might give insights into specific configurations required.

By following these steps, you should be able to diagnose the loading error and make the necessary adjustments to successfully load your application project into the external memory.