Skip to content

Commit 5075db7

Browse files
authored
Merge pull request #705 from bigbrett/tc3-self-update-fixes
Tc3 self-update fixes
2 parents 63bad13 + 341ca13 commit 5075db7

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

arch.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,6 @@ ifeq ($(ARCH), AURIX_TC3)
13621362
# TC3xx specific
13631363
ifeq ($(TARGET), aurix_tc3xx)
13641364
USE_GCC?=1
1365-
ARCH_FLASH_OFFSET=0x00000000
13661365

13671366
CFLAGS += -I$(TC3_DIR) -Ihal
13681367

@@ -1408,6 +1407,7 @@ ifeq ($(ARCH), AURIX_TC3)
14081407
endif
14091408

14101409
ifeq ($(AURIX_TC3_HSM),1)
1410+
ARCH_FLASH_OFFSET=0x80028000
14111411
# HSM compiler flags, build options, source code, etc
14121412
ifeq ($(USE_GCC),1)
14131413
# Just arm-none-eabi-gcc for now
@@ -1476,6 +1476,7 @@ ifeq ($(ARCH), AURIX_TC3)
14761476

14771477
else
14781478
# Tricore compiler settings
1479+
ARCH_FLASH_OFFSET=0x800A0000
14791480
ifeq ($(USE_GCC),1)
14801481
HT_ROOT?=/opt/hightec/gnutri_v4.9.4.1-11fcedf-lin64
14811482
CROSS_COMPILE?=$(HT_ROOT)/bin/tricore-

hal/aurix_tc3xx.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,13 @@ void do_boot(const uint32_t* app_offset)
348348
}
349349
#endif
350350

351-
void arch_reboot(void)
351+
RAMFUNCTION void arch_reboot(void)
352352
{
353+
#ifdef WOLFBOOT_AURIX_TC3XX_HSM
354+
tc3arm_HsmBridgeSysReset();
355+
#else
353356
tc3_Scu_TriggerSwReset(1, WOLFBOOT_AURIX_RESET_REASON);
357+
#endif
354358
}
355359

356360
/* Programs unaligned input data to flash, assuming the underlying memory is
@@ -612,15 +616,15 @@ int RAMFUNCTION hal_flash_erase(uint32_t address, int len)
612616
/* If the IAP interface of the flash memory of the target requires it, this
613617
* function is called before every write and erase operations to unlock write
614618
* access to the flash. On some targets, this function may be empty. */
615-
void hal_flash_unlock(void) {}
619+
RAMFUNCTION void hal_flash_unlock(void) {}
616620

617621
/* If the IAP interface of the flash memory requires locking/unlocking, this
618622
* function restores the flash write protection by excluding write accesses.
619623
* This function is called by the bootloader at the end of every write and erase
620624
* operations. */
621-
void hal_flash_lock(void) {}
625+
RAMFUNCTION void hal_flash_lock(void) {}
622626

623-
int ext_flash_write(uintptr_t address, const uint8_t* data, int len)
627+
RAMFUNCTION int ext_flash_write(uintptr_t address, const uint8_t* data, int len)
624628
{
625629
return hal_flash_write(address, data, len);
626630
}
@@ -685,17 +689,17 @@ int RAMFUNCTION ext_flash_read(uintptr_t address, uint8_t* data, int len)
685689
return 0;
686690
}
687691

688-
int ext_flash_erase(uintptr_t address, int len)
692+
RAMFUNCTION int ext_flash_erase(uintptr_t address, int len)
689693
{
690694
return hal_flash_erase(address, len);
691695
}
692696

693-
void ext_flash_lock(void)
697+
RAMFUNCTION void ext_flash_lock(void)
694698
{
695699
hal_flash_lock();
696700
}
697701

698-
void ext_flash_unlock(void)
702+
RAMFUNCTION void ext_flash_unlock(void)
699703
{
700704
hal_flash_unlock();
701705
}

0 commit comments

Comments
 (0)