@@ -118,7 +118,9 @@ static LDFileMemoryInfo FindLdsFile(string pDir, string sdname)
118
118
. ToArray ( ) ;
119
119
120
120
var maxRAM = allMatchingLinkerScripts . OrderBy ( s => s . RAM . Origin ) . Last ( ) ;
121
- var maxFLASH = allMatchingLinkerScripts . OrderBy ( s => s . FLASH . Origin ) . Last ( ) ;
121
+ // var maxRAM = allMatchingLinkerScripts.OrderBy(s => s.RAM.Length).Last();
122
+ var maxFLASH = allMatchingLinkerScripts . OrderBy ( s => s . FLASH . Origin ) . Last ( ) ;
123
+ // var maxFLASH = allMatchingLinkerScripts.OrderBy(s => s.FLASH.Length).Last();
122
124
123
125
if ( ! maxFLASH . FLASH . Equals ( maxRAM . FLASH ) )
124
126
throw new Exception ( "Inconsistent maximum linker scripts" ) ; //The 'max RAM' script has a different FLASH size than the 'max FLASH' script.
@@ -312,10 +314,10 @@ internal void GenerateSoftdeviceLibraries()
312
314
{
313
315
abi = " \" -mfloat-abi=soft\" " ;
314
316
}
315
-
317
+
316
318
string hexFileName = Path . GetFullPath ( Directory . GetFiles ( sdDir , "*.hex" ) [ 0 ] ) ;
317
319
var info = new ProcessStartInfo { FileName = BSPRoot + @"\nRF5x\SoftdeviceLibraries\ConvertSoftdevice.bat" , Arguments = sd . Name + " " + hexFileName + abi , UseShellExecute = false } ;
318
- info . EnvironmentVariables [ "PATH" ] += @";e :\sysgcc\arm-eabi\bin" ;
320
+ info . EnvironmentVariables [ "PATH" ] += @";c :\sysgcc\arm-eabi\bin" ;
319
321
Process . Start ( info ) . WaitForExit ( ) ;
320
322
string softdevLib = string . Format ( @"{0}\nRF5x\SoftdeviceLibraries\{1}_softdevice.o" , BSPRoot , sd . Name ) ;
321
323
if ( ! File . Exists ( softdevLib ) || File . ReadAllBytes ( softdevLib ) . Length < 32768 )
@@ -455,27 +457,14 @@ static void Main(string[] args)
455
457
456
458
if ( args . Length < 1 )
457
459
throw new Exception ( "Usage: nrf5x.exe <Nordic SW package directory>" ) ;
458
- bool usingIoTSDK = false ;
460
+ bool usingIoTSDK = false ;
459
461
460
- /* if (Directory.Exists(Path.Combine(args[0], @"components\iot\ble_6lowpan")))
461
- {
462
- usingIoTSDK = true;
463
- Console.WriteLine("Detected IoT SDK");
464
- }*/
465
462
466
- if ( usingIoTSDK )
467
- {
468
- bspBuilder = new NordicBSPBuilder ( new BSPDirectories ( args [ 0 ] , @"..\..\Output" , @"..\..\rules_iot" ) ) ;
469
- bspBuilder . SoftDevices . Add ( new NordicBSPBuilder . SoftDevice ( "s1xx_iot" , 0x1f000 , 0x2800 , "nrf52" , "IoT" , bspBuilder . Directories . InputDir ) ) ;
470
- }
471
- else
472
- {
473
463
bspBuilder = new NordicBSPBuilder ( new BSPDirectories ( args [ 0 ] , @"..\..\Output" , @"..\..\rules" ) ) ;
474
464
bspBuilder . SoftDevices . Add ( new NordicBSPBuilder . SoftDevice ( "S132" , "nrf52832.*" , null , bspBuilder . Directories . InputDir ) ) ;
475
465
bspBuilder . SoftDevices . Add ( new NordicBSPBuilder . SoftDevice ( "S140" , "nrf52840.*" , null , bspBuilder . Directories . InputDir ) ) ;
476
466
bspBuilder . SoftDevices . Add ( new NordicBSPBuilder . SoftDevice ( "S112" , "nrf52810.*" , null , bspBuilder . Directories . InputDir ) ) ;
477
- }
478
- List < MCUBuilder > devices = new List < MCUBuilder > ( ) ;
467
+ List < MCUBuilder > devices = new List < MCUBuilder > ( ) ;
479
468
480
469
#if NRF51_SUPPORT
481
470
if ( ! usingIoTSDK )
@@ -487,12 +476,13 @@ static void Main(string[] args)
487
476
}
488
477
#endif
489
478
479
+ devices . Add ( new MCUBuilder { Name = "nRF52832_XXAA" , FlashSize = 512 * 1024 , RAMSize = 64 * 1024 , Core = CortexCore . M4 , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/modules/nrfx/mdk/gcc_startup_nrf52.S" } ) ;
480
+ devices . Add ( new MCUBuilder { Name = "nRF52840_XXAA" , FlashSize = 1024 * 1024 , RAMSize = 256 * 1024 , Core = CortexCore . M4 , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/modules/nrfx/mdk/gcc_startup_nrf52840.S" } ) ;
481
+ if ( ! usingIoTSDK )
482
+ devices . Add ( new MCUBuilder { Name = "nRF52810_XXAA" , FlashSize = 192 * 1024 , RAMSize = 24 * 1024 , Core = CortexCore . M4_NOFPU , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/modules/nrfx/mdk/gcc_startup_nrf52810.S" } ) ;
483
+
490
484
491
- devices . Add ( new MCUBuilder { Name = "nRF52832_XXAA" , FlashSize = 512 * 1024 , RAMSize = 64 * 1024 , Core = CortexCore . M4 , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/components/toolchain/gcc/gcc_startup_nrf52.S" } ) ;
492
- devices . Add ( new MCUBuilder { Name = "nRF52840_XXAA" , FlashSize = 1024 * 1024 , RAMSize = 256 * 1024 , Core = CortexCore . M4 , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/components/toolchain/gcc/gcc_startup_nrf52840.S" } ) ;
493
- devices . Add ( new MCUBuilder { Name = "nRF52810_XXAA" , FlashSize = 192 * 1024 , RAMSize = 24 * 1024 , Core = CortexCore . M4_NOFPU , StartupFile = "$$SYS:BSP_ROOT$$/nRF5x/components/toolchain/gcc/gcc_startup_nrf52810.S" } ) ;
494
-
495
- List < MCUFamilyBuilder > allFamilies = new List < MCUFamilyBuilder > ( ) ;
485
+ List < MCUFamilyBuilder > allFamilies = new List < MCUFamilyBuilder > ( ) ;
496
486
foreach ( var fn in Directory . GetFiles ( bspBuilder . Directories . RulesDir + @"\Families" , "*.xml" ) )
497
487
allFamilies . Add ( new NordicFamilyBuilder ( bspBuilder , XmlTools . LoadObject < FamilyDefinition > ( fn ) ) ) ;
498
488
@@ -553,7 +543,7 @@ static void Main(string[] args)
553
543
{
554
544
new CopyJob
555
545
{
556
- SourceFolder = allFamilies [ 0 ] . Definition . PrimaryHeaderDir + @"\..\components\ble\" + dir ,
546
+ SourceFolder = allFamilies [ 0 ] . Definition . PrimaryHeaderDir + @"\..\..\..\ components\ble\" + dir ,
557
547
TargetFolder = dir ,
558
548
FilesToCopy = "*.c;*.h" ,
559
549
}
@@ -656,7 +646,8 @@ static void Main(string[] args)
656
646
defaultConfig = "pca10040/s132" ;
657
647
658
648
suffixEntry = new SysVarEntry { Key = "com.sysprogs.nordic.default_config_suffix" , Value = defaultConfig } ;
659
- mcuDef . AdditionalSystemVars = LoadedBSP . Combine ( mcuDef . AdditionalSystemVars , new SysVarEntry [ ] { suffixEntry } ) ;
649
+ mcuDef . AdditionalSystemVars = LoadedBSP . Combine ( mcuDef . AdditionalSystemVars , new SysVarEntry [ ] { suffixEntry ,
650
+ new SysVarEntry { Key = "com.sysprogs.nordic.default_config_suffix_blank" , Value = "pca10040" } } ) ;
660
651
661
652
mcuDefinitions . Add ( mcuDef ) ;
662
653
}
@@ -666,8 +657,11 @@ static void Main(string[] args)
666
657
667
658
foreach ( var fw in fam . GenerateFrameworkDefinitions ( ) )
668
659
frameworks . Add ( fw ) ;
669
-
670
- foreach ( var sample in fam . CopySamples ( null , new SysVarEntry [ ] { new SysVarEntry { Key = "com.sysprogs.nordic.default_config_suffix" , Value = "pca10040e/s112" } } ) )
660
+ string dirpca = "pca10040e/s112" ;
661
+ if ( usingIoTSDK )
662
+ dirpca = "pca10040/s132" ;
663
+ foreach ( var sample in fam . CopySamples ( null , new SysVarEntry [ ] { new SysVarEntry { Key = "com.sysprogs.nordic.default_config_suffix" , Value = dirpca } ,
664
+ new SysVarEntry { Key = "com.sysprogs.nordic.default_config_suffix_blank" , Value = "pca10040" } } ) )
671
665
exampleDirs . Add ( sample ) ;
672
666
}
673
667
@@ -688,21 +682,11 @@ static void Main(string[] args)
688
682
689
683
Console . WriteLine ( "Building BSP archive..." ) ;
690
684
string strPackageID , strPackageDesc , strPAckVersion ;
691
- if ( usingIoTSDK )
692
- {
693
- strPackageID = "com.sysprogs.arm.nordic.nrf5x-iot" ;
694
- strPackageDesc = "Nordic NRF52 IoT" ;
695
- strPAckVersion = "0.9" ;
685
+
686
+ strPackageID = "com.sysprogs.arm.nordic.nrf5x" ;
687
+ strPackageDesc = "Nordic NRF52x Devices" ;
688
+ strPAckVersion = "14.2R2" ;
696
689
697
- foreach ( var mcu in mcuDefinitions )
698
- mcu . UserFriendlyName = mcu . ID + " (IoT)" ;
699
- }
700
- else
701
- {
702
- strPackageID = "com.sysprogs.arm.nordic.nrf5x" ;
703
- strPackageDesc = "Nordic NRF52x Devices" ;
704
- strPAckVersion = "14.2R2" ;
705
- }
706
690
707
691
BoardSupportPackage bsp = new BoardSupportPackage
708
692
{
@@ -722,7 +706,6 @@ static void Main(string[] args)
722
706
InitializationCodeInsertionPoints = commonPseudofamily . Definition . InitializationCodeInsertionPoints ,
723
707
} ;
724
708
725
- bspBuilder . ValidateBSP ( bsp ) ;
726
709
bspBuilder . Save ( bsp , true , false ) ;
727
710
}
728
711
}
0 commit comments