[SOLVED] Options Bytes für STM32 programmieren

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Options Bytes für STM32 programmieren

    Hallo zusammen,

    wir möchten für den STM32L051C6 den BOR einschalten (Level 5). Lt Ref Manual müssen dazu im FLASH_OPTR Register die Bits 19 bis 16 auf 1100 gesetzt werden. Wenn ich es richtig verstanden habe werden die bits 31 bis 16 dieses Registers beim Booten automatisch mit den Option Bytes von Adresse 0x1FF8 0004 geladen. Wobei hier in den Bits 31:16 die negierte Form und in 15:0 die nicht negierte Form der zu setzenden Bits stehen muss. Also versuchen wir ein 0x7F83 807C an die Adresse zu schreiben. Wir haben es mit dem STLink Commander und mit exit steps im J-Flash versucht (Anbei ein Bild von dem versuch mit J-Flash).

    Leider steht nach dem Reset immer noch der Default Wert im FLASH_OPTR Register. Auch das vorherige rücksetzten der OPT_LOCK und PE_LOCK Bits mit den Keys brachte keine Änderung.
    Was machen wir falsch???
    Ich hoffe jemand kann weiterhelfen....

    Gruß
    Jahn
    Images
    • bor_settings_f-flash.png

      17.17 kB, 500×504, viewed 1,766 times
  • Hello Jahn,

    Thank you for your inquiry.
    Per forum rules this is a English language Forum. Please only write in English in this Forum.

    On first glance it seems like your read out protection sequence is incorrect.
    You can find example J-Flash projects on our Wiki page: wiki.segger.com/STM32#Enabling_readout_protection

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    sorry for not writing in english, i will change that now :)

    I tried to use the files. But i still have trouble. I tried to do exact the same steps from the L0 file, only with a different value for the option register. But it did not help.

    Then i tried to use your file and i only changed the controller to our type. This did not work too.

    With Commander also no read out protection. See picture attached. I'm very confused. ?(

    I hope someone can help
    Images
    • stm32l_options_with_commander.png

      56.41 kB, 1,410×926, viewed 947 times
  • Hello,

    Do not select the "allow opt bytes" device name but just the regular one.
    Then everything should be working as expected.
    The allow opt bytes device name is meant for cases where the opt bytes are part of your image that you want to flash.
    So you can program it in one go.
    The J-Link Commander sample works with direct memory writes which would not work for the allow opt bytes device.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    Great to hear that you are up and running again.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.