aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-01-19 10:25:09 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-01-19 10:25:09 +0200
commit13b01cc6e2539dae0063f8cf23909e07982dfbb9 (patch)
treee9eeab104e153a01ab010916b39cb13f6e78a2d4 /Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c
parent1cb784093175d3d1aa73a8361156e9a5eaaf487c (diff)
downloadTango-13b01cc6e2539dae0063f8cf23909e07982dfbb9.tar.gz
Tango-13b01cc6e2539dae0063f8cf23909e07982dfbb9.zip
fix flash programming, alarm handling. workaround I2C arbitration loast, remove all "wait forever" in I2C sem
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c
index 43a038996..9167a33d2 100644
--- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c
+++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/FlashProgram.c
@@ -45,6 +45,7 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b
uint32_t ui32ProgAddr;
uint32_t ui32BufferAddr;
volatile uint32_t ui32Idx;
+ uint32_t status = OK;
//uint32_t ui32FlashEnd;
#ifdef FLASH_DEBUG
@@ -102,8 +103,11 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b
// Call the function to program a block of flash. The length of the
// block passed to the flash function must be divisible by 4.
//
- FlashProgram((uint32_t *)ui32BufferAddr, ui32ProgAddr,
+
+ status = FlashProgram((uint32_t *)ui32BufferAddr, ui32ProgAddr,
(ui32DataSize + 3) & ~3);
+ if (status)
+ LOG_ERROR(status,"ROM_FlashProgram");
//
// If there is more image to program, then update the programming
@@ -129,6 +133,7 @@ uint32_t ReadAppAndProgram(uint32_t ui32FlashStart,uint32_t ui32FileSize,void* b
uint32_t EraseFlashSection(uint32_t ui32FlashStart,uint32_t ui32FileSize)
{
volatile uint32_t ui32Idx;
+ uint32_t status;
#ifdef FLASH_DEBUG
Address[RxIndex] = ui32FlashStart;
Size[RxIndex] = ui32FileSize;
@@ -138,7 +143,7 @@ uint32_t EraseFlashSection(uint32_t ui32FlashStart,uint32_t ui32FileSize)
#endif
for(ui32Idx = ui32FlashStart; ui32Idx < ui32FlashStart+ui32FileSize; ui32Idx += 1024)
{
- FlashErase(ui32Idx);
+ //status = FlashErase(ui32Idx);
}
return OK;