Skip to content

Commit

Permalink
[REL] Ready for v5.3.1
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Heng <[email protected]>
  • Loading branch information
JayHeng committed Sep 22, 2023
1 parent 10c8c7a commit a18af67
Show file tree
Hide file tree
Showing 30 changed files with 306 additions and 66 deletions.
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gantt

# NXP MCU Boot Utility

[![GitHub release](https://img.shields.io/github/release/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/JayHeng/NXP-MCUBootUtility/v5.3.0.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/compare/v5.3.0...master) ![GitHub All Releases](https://img.shields.io/github/downloads/JayHeng/NXP-MCUBootUtility/total.svg) [![GitHub license](https://img.shields.io/github/license/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/JayHeng/NXP-MCUBootUtility/v5.3.1.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/compare/v5.3.1...master) ![GitHub All Releases](https://img.shields.io/github/downloads/JayHeng/NXP-MCUBootUtility/total.svg) [![GitHub license](https://img.shields.io/github/license/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/blob/master/LICENSE)

[English](./README.md) | 中文

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ gantt

# NXP MCU Boot Utility

[![GitHub release](https://img.shields.io/github/release/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/JayHeng/NXP-MCUBootUtility/v5.3.0.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/compare/v5.3.0...master) ![GitHub All Releases](https://img.shields.io/github/downloads/JayHeng/NXP-MCUBootUtility/total.svg) [![GitHub license](https://img.shields.io/github/license/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/releases/latest) [![GitHub commits](https://img.shields.io/github/commits-since/JayHeng/NXP-MCUBootUtility/v5.3.1.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/compare/v5.3.1...master) ![GitHub All Releases](https://img.shields.io/github/downloads/JayHeng/NXP-MCUBootUtility/total.svg) [![GitHub license](https://img.shields.io/github/license/JayHeng/NXP-MCUBootUtility.svg)](https://github.com/JayHeng/NXP-MCUBootUtility/blob/master/LICENSE)

English | [中文](./README-zh.md)

Expand Down
Binary file modified bin/NXP-MCUBootUtility.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions src/boot/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,19 @@ def __init__(self, cpu, board='', build='', **kwargs):
self.availableBootDevices = misc.get_dict_default(kwargs, 'availableBootDevices', None)
self.flexspiNorDevice = misc.get_dict_default(kwargs, 'flexspiNorDevice', None)
self.flexspiNorMemBase = misc.get_dict_default(kwargs, 'flexspiNorMemBase0', None)
self.flexspiNorMemMaxSize = misc.get_dict_default(kwargs, 'flexspiNorMem0MaxSize', None)
self.flexspiNorMemBase0 = misc.get_dict_default(kwargs, 'flexspiNorMemBase0', None)
self.flexspiNorMemBase0Ns = misc.get_dict_default(kwargs, 'flexspiNorMemBase0Ns', None)
self.flexspiNorMemBase0Aliased = misc.get_dict_default(kwargs, 'flexspiNorMemBase0Aliased', None)
self.flexspiNorMemBase0AliasedNs = misc.get_dict_default(kwargs, 'flexspiNorMemBase0AliasedNs', None)
self.flexspiNorMem0MaxSize = misc.get_dict_default(kwargs, 'flexspiNorMem0MaxSize', None)
self.flexspiNorMem0AliasedMaxSize = misc.get_dict_default(kwargs, 'flexspiNorMem0AliasedMaxSize', None)
self.flexspiNorMemBase1 = misc.get_dict_default(kwargs, 'flexspiNorMemBase1', None)
self.flexspiNorMemBase1Ns = misc.get_dict_default(kwargs, 'flexspiNorMemBase1Ns', None)
self.flexspiNorMemBase1Aliased = misc.get_dict_default(kwargs, 'flexspiNorMemBase1Aliased', None)
self.flexspiNorMemBase1AliasedNs = misc.get_dict_default(kwargs, 'flexspiNorMemBase1AliasedNs', None)
self.flexspiNorMem1MaxSize = misc.get_dict_default(kwargs, 'flexspiNorMem1MaxSize', None)
self.flexspiNorMem1AliasedMaxSize = misc.get_dict_default(kwargs, 'flexspiNorMem1AliasedMaxSize', None)
self.flexspiFreqs = misc.get_dict_default(kwargs, 'flexspiFreqs', None)
self.xspiNorCfgInfoOffset = misc.get_dict_default(kwargs, 'xspiNorCfgInfoOffset', None)
self.flexspiNorEfuseBootCfg0Bits = misc.get_dict_default(kwargs, 'flexspiNorEfuseBootCfg0Bits', None)
Expand Down
2 changes: 1 addition & 1 deletion src/gen/LPC_gencore.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def _LPC_getImageInfo( self, srcAppFilename ):
return startAddress, entryPointAddress, lengthInByte

def _LPC_isValidNonXipAppImage( self, imageStartAddr ):
if self.isInTheRangeOfSramx(imageStartAddr, 1):
if self.isInTheRangeOfSram(imageStartAddr, 1):
return True
else:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_invalidNonXipRange2'][self.languageIndex])
Expand Down
8 changes: 5 additions & 3 deletions src/gen/RTxxx_gencore.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def _updateJsonfileContent( self, secureBootType, bootDevice, vectorAddress, ent
def _RTxxx_isValidNonXipAppImage( self, imageStartAddr ):
if self.isInTheRangeOfSram(imageStartAddr, 1):
return True
elif self.isInTheRangeOfFlexspiRam(imageStartAddr, 1):
return True
else:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_invalidNonXipRange'][self.languageIndex])
return False
Expand All @@ -232,12 +234,12 @@ def RTxxx_createMatchedAppJsonfile( self ):
self.destAppVectorAddress = imageStartAddr
if self.bootDevice == RTxxx_uidef.kBootDevice_FlexspiNor:
self.adjustTgtFlexspiMemBaseAccordingToApp(imageStartAddr)
if ((imageStartAddr >= self.tgt.flexspiNorMemBase) and (imageStartAddr < self.tgt.flexspiNorMemBase + rundef.kBootDeviceMemXipSize_FlexspiNor)):
if (imageStartAddr + imageLength <= self.tgt.flexspiNorMemBase + RTxxx_rundef.kBootDeviceMemXipSize_FlexspiNor):
if ((imageStartAddr >= self.tgt.flexspiNorMemBase) and (imageStartAddr < self.tgt.flexspiNorMemBase + self.tgt.flexspiNorMemMaxSize)):
if (imageStartAddr + imageLength <= self.tgt.flexspiNorMemBase + self.tgt.flexspiNorMemMaxSize):
self.isXipApp = True
self.destAppVectorOffset = imageStartAddr - self.tgt.flexspiNorMemBase
else:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_xipSizeTooLarge'][self.languageIndex] + u"0x%s !" %(rundef.kBootDeviceMemXipSize_FlexspiNor))
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_xipSizeTooLarge'][self.languageIndex] + u"0x%s !" %(self.tgt.flexspiNorMemMaxSize))
return False
else:
#self.destAppVectorOffset = RTyyyy_gendef.kInitialLoadSize_NOR
Expand Down
15 changes: 9 additions & 6 deletions src/gen/RTyyyy_gencore.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def _verifyAppVectorAddressForBd( self, vectorAddr, initialLoadSize ):
executeBase = self.tgt.memoryRange['itcm_sec'].start
elif (('dtcm_sec' in self.tgt.memoryRange) and ((vectorAddr >= self.tgt.memoryRange['dtcm_sec'].start) and (vectorAddr < self.tgt.memoryRange['dtcm_sec'].start + self.tgt.memoryRange['dtcm_sec'].length))):
executeBase = self.tgt.memoryRange['dtcm_sec'].start
elif ((vectorAddr >= self.tgt.flexspiNorMemBase) and (vectorAddr < self.tgt.flexspiNorMemBase + RTyyyy_rundef.kBootDeviceMemXipSize_FlexspiNor)):
elif ((vectorAddr >= self.tgt.flexspiNorMemBase) and (vectorAddr < self.tgt.flexspiNorMemBase + self.tgt.flexspiNorMemMaxSize)):
executeBase = self.tgt.flexspiNorMemBase
elif ((vectorAddr >= RTyyyy_rundef.kBootDeviceMemBase_SemcNor) and (vectorAddr < RTyyyy_rundef.kBootDeviceMemBase_SemcNor + RTyyyy_rundef.kBootDeviceMemXipSize_SemcNor)):
executeBase = RTyyyy_rundef.kBootDeviceMemBase_SemcNor
Expand Down Expand Up @@ -986,15 +986,16 @@ def isCertificateGenerated( self, secureBootType ):
else:
pass

def _RTyyyy_isValidNonXipAppImage( self, imageStartAddr ):
def _RTyyyy_isValidNonXipAppImage( self, imageStartAddr, showError=True ):
if self.isInTheRangeOfFlexram(imageStartAddr, 1):
return True
elif self.isInTheRangeOfFlexspiRam(imageStartAddr, 1):
return True
elif ((imageStartAddr >= RTyyyy_rundef.kBootDeviceMemBase_SemcSdram) and (imageStartAddr < RTyyyy_rundef.kBootDeviceMemBase_SemcSdram + RTyyyy_rundef.kBootDeviceMemMaxSize_SemcSdram)):
return True
else:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_invalidNonXipRange'][self.languageIndex])
if showError:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_invalidNonXipRange'][self.languageIndex])
return False

def _RTyyyy_isValidAppImage( self, imageStartAddr ):
Expand Down Expand Up @@ -1047,8 +1048,8 @@ def _createMatchedAppInfofile( self, ideRetryType ):
self.destAppVectorAddress = imageStartAddr
if self.bootDevice == RTyyyy_uidef.kBootDevice_FlexspiNor:
self.adjustTgtFlexspiMemBaseAccordingToApp(imageStartAddr)
if ((imageStartAddr >= self.tgt.flexspiNorMemBase) and (imageStartAddr < self.tgt.flexspiNorMemBase + rundef.kBootDeviceMemXipSize_FlexspiNor)):
if (imageStartAddr + imageLength <= self.tgt.flexspiNorMemBase + rundef.kBootDeviceMemXipSize_FlexspiNor):
if ((imageStartAddr >= self.tgt.flexspiNorMemBase) and (imageStartAddr < self.tgt.flexspiNorMemBase + self.tgt.flexspiNorMemMaxSize)):
if (imageStartAddr + imageLength <= self.tgt.flexspiNorMemBase + self.tgt.flexspiNorMemMaxSize):
self.isXipApp = True
self.destAppVectorOffset = imageStartAddr - self.tgt.flexspiNorMemBase
minReservedSize = 0
Expand All @@ -1063,7 +1064,7 @@ def _createMatchedAppInfofile( self, ideRetryType ):

return False
else:
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_xipSizeTooLarge'][self.languageIndex] + str(hex(rundef.kBootDeviceMemXipSize_FlexspiNor)) + " !")
self.popupMsgBox(uilang.kMsgLanguageContentDict['srcImgError_xipSizeTooLarge'][self.languageIndex] + str(hex(self.tgt.flexspiNorMemMaxSize)) + " !")
return False
else:
if self.tgt.bootHeaderType == gendef.kBootHeaderType_Container:
Expand Down Expand Up @@ -1352,6 +1353,7 @@ def _genCompleteAppWithContainer( self ):
finalBtAppData += edgelockFwBytes
##############################################################
num = self.destAppVectorOffset - self.destAppInitialLoadSize
#self.printDeviceStatus("tgt.flexspiNorMemBase = " + str(hex(self.tgt.flexspiNorMemBase)))
#self.printDeviceStatus("destAppContainerOffset = " + str(hex(self.destAppContainerOffset)))
#self.printDeviceStatus("destAppVectorOffset = " + str(hex(self.destAppVectorOffset)))
#self.printDeviceStatus("destAppInitialLoadSize = " + str(hex(self.destAppInitialLoadSize)))
Expand All @@ -1361,6 +1363,7 @@ def _genCompleteAppWithContainer( self ):
with open(self.destAppContainerFilename, 'wb') as fileObj:
fileObj.write(finalBtAppData)
fileObj.close()
self.printLog('Bootable image is generated: ' + self.destAppContainerFilename)

def RTyyyy_genBootableImage( self ):
if self.tgt.bootHeaderType == gendef.kBootHeaderType_IVT:
Expand Down
Loading

0 comments on commit a18af67

Please sign in to comment.