Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY FOR test] Add f7 bl update #11394

Merged
merged 3 commits into from
Jun 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/platforms/px4_micro_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ __BEGIN_DECLS
# if defined(CONFIG_ARCH_CHIP_STM32F7)
# define PX4_SOC_ARCH_ID PX4_SOC_ARCH_ID_STM32F7
# include <chip.h>
# include <chip/stm32_flash.h>
void stm32_flash_lock(void);
void stm32_flash_unlock(void);
int stm32_flash_writeprotect(size_t page, bool enabled);
# include <up_internal.h> //include up_systemreset() which is included on stm32.h
# include <stm32_bbsram.h>
# define PX4_BBSRAM_SIZE STM32F7_BBSRAM_SIZE
Expand Down
11 changes: 6 additions & 5 deletions src/systemcmds/bl_update/bl_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/**
* @file bl_update.c
*
* STM32F4 bootloader update tool.
* STM32F4 & STM32F7 bootloader update tool.
*/

#include <px4_config.h>
Expand All @@ -58,7 +58,7 @@

__EXPORT int bl_update_main(int argc, char *argv[]);

#if defined (CONFIG_STM32_STM32F4XXX)
#if defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7)
static int setopt(void);

static void print_usage(const char *reason)
Expand All @@ -75,12 +75,13 @@ static void print_usage(const char *reason)
PRINT_MODULE_USAGE_COMMAND_DESCR("<file>", "Bootloader bin file");
}

#endif
#endif // defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7)


int
bl_update_main(int argc, char *argv[])
{
#if !defined (CONFIG_STM32_STM32F4XXX)
#if !(defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7))
PX4_ERR("Not supported on this HW");
return 1;
}
Expand Down Expand Up @@ -242,4 +243,4 @@ setopt(void)
PX4_ERR("option bits setting failed; readback 0x%04" PRIx32, *optcr);
return 1;
}
#endif // CONFIG_STM32_STM32F4XXX
#endif // defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7)