Failed to create Flash Loader.

Comments

6 comments

  • Avatar
    Jon Elliott

    The best way to debug a FLASH loader is to add calls to libmem_erase, libmem_write and libmem_flush directly after the call to libmem_m480_register_internal_flash_driver in loader.c and use the debugger to check that those functions work correctly.

    0
    Comment actions Permalink
  • Avatar
    Yoon-Ki Hong

    Hi Jon Elliott sir,

    I will try the method you suggested.

    Thank you!!

    0
    Comment actions Permalink
  • Avatar
    Yoon-Ki Hong

    Hi Jon Elliott sir,

    The program download was successful. However, a different value is written to address 0x80, as shown in the image below.

    Is there any way to debug the above symptoms?

    Thank you.

    0
    Comment actions Permalink
  • Avatar
    Yoon-Ki Hong

    Hi Jon Elliott sir,

    It's finally working properly. I made a mistake while reimplementing the assembly code for M480 into C source code.

    I feel so good! thank you!

    0
    Comment actions Permalink
  • Avatar
    Jorden james

    Hey Yoon-Ki Hong,

    Aside from implementing EraseSector and ProgramPage, ensure memory mapping, timing, and register operations match the original assembly. Also, check for stack handling, compiler optimizations, and debugging outputs. Debugging complex issues like this can be as tricky as perfecting a recipe for delicious food! If it still fails, could you share more details on the issue?

    0
    Comment actions Permalink
  • Avatar
    Yoon-Ki Hong

    Hi Jorden james,

    The job is now completed and working fine.

    This was a problem that occurred when I was translating assembly code to C and copying code that I didn't understand. I don't understand exactly what the purpose of the assembly code lines in the link below are.

    https://github.com/mymy49/CrossworksForARM_Nuvoton_M43x/blob/282ed35384309b2e86320677144fc5836088570d/targets/M43x/Loader/M43x_AP_128_flm.s#L55 

    I removed the parts that were incorrectly translated into C language, as shown in the link below. it works normally.

    https://github.com/mymy49/CrossworksForARM_Nuvoton_M43x/commit/8c25ad678a06850ff581416132ca4b37fcdc3b73#diff-fbbed4c4ebd684805ac2c2a57bfad3346d780c3c14e46367c8604452e1d6b6e7L47 

    Thank you!!

    0
    Comment actions Permalink

Please sign in to leave a comment.