dmitrystu / sboot_stm32

Secure USB DFU1.1 bootloader for STM32
Apache License 2.0
303 stars 63 forks source link

Add bootstrap pin configuration #7

Closed sn00pster closed 5 years ago

sn00pster commented 5 years ago

Adds configuration options for the boot pin, 2 new defines:

DFU_BOOTSTRAP_PULL:

Can be set to _UP, _DOWN or _NONE to set the desired capability

DFU_BOOTSTRAP_LEVEL:

Can be set to _HIGH or _LOW, allows the logic level to be set according to hardware

(Some of the startup assembler files were including "../config.h" rather than "config.h", I have changed these to "config.h" as it allows sboot_stm32 to be used as a submodule without having to make file changes in tree, you just copy config.h to your own include directory and it uses that version)

dmitrystu commented 5 years ago

Thank you for your contribution.

I have made a bit different way:

#define DFU_BOOTSTRAP_LEVEL _HIGH/_LOW
#define DFU_BOOTSTRAP_PULL _ENABLE/_DISABLE //in opposite of level if enabled

Tested yesterday with F103 and L433. Perhaps you forgot to add changes on jumps between bootloader and application.

sn00pster commented 5 years ago

Perhaps you forgot to add changes on jumps between bootloader and application.

Sorry, I don't understand what you're saying here. Have I missed something out?

I've tested it on L475RC and its working fine, as far as I know I implemented the rest of the changes as necessary for the other micros?

sn00pster commented 5 years ago

Oh hang on, I see what you mean. I must have removed part of the ifdef when I was cleaning up, let me fix that.

Sorry!

sn00pster commented 5 years ago

@dmitrystu I've updated the code with the changes, sorry about that, in my haste I just missed out the actual final bit of logic.