You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.2 KiB

12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
11 months ago
12 months ago
  1. #pragma once
  2. #include <stdbool.h>
  3. #include "project_configs.h"
  4. #include "zbase.h"
  5. /**
  6. * @brief
  7. * STM32F407VETx 512k
  8. *
  9. * index startAdd size
  10. * 0 0x08000000 16k
  11. * 1 0x08004000 16k
  12. * 2 0x08008000 16k
  13. * 3 0x0800C000 16k
  14. * 4 0x08010000 64k
  15. * 5 0x08020000 128k
  16. * 6 0x08040000 128k
  17. * 7 0x08060000 128k
  18. * 8 0x08080000 128k
  19. * 9 0x080A0000 128k
  20. * 10 0x080C0000 128k
  21. * 11 0x080E0000 128k
  22. *
  23. */
  24. #define FLASH_MASK_VAL 0xABCD
  25. // #define FLASH_START_ADD SDK_CFG__CFG_FLASH_ADDR //
  26. // #define FLASH_EARSE_SECTOR FLASH_SECTOR_7
  27. // #define FLASH_SOTRAGE_SIZE (128 * 1023)
  28. /**
  29. * @brief
  30. *
  31. * @param rawstartadd
  32. * @param defaultdata
  33. * @param rawsize
  34. */
  35. void zflash_init(uint32_t* flashadd, uint32_t flashSector, uint32_t* rawstartadd, uint32_t rawsize);
  36. /**
  37. * @brief
  38. *
  39. * @return true
  40. * @return false
  41. */
  42. bool zflash_is_first_run(void);
  43. /**
  44. * @brief
  45. *
  46. * @return true
  47. * @return false
  48. */
  49. bool zflash_flush(void);
  50. /**
  51. * @brief
  52. *
  53. * @return true
  54. * @return false
  55. */
  56. bool zflash_factory_reset(void);
  57. /**
  58. * @brief
  59. *
  60. * @param defaultdata
  61. * @return true
  62. * @return false
  63. */
  64. bool zflash_set_default_data(uint32_t* defaultdata);
  65. bool zflash_check(void);