Skip to content

Commit ff06308

Browse files
author
Nathan Posey
committed
Update the FSL headers and flash driver
- Using the new version of our generated headers that uses base address style macros - Update to our latest flash driver - Have K24S support in here with all necessary files besides the project changes to build it, will wait for the updated project generator commit and then add
1 parent 9fbff19 commit ff06308

File tree

385 files changed

+296931
-237651
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+296931
-237651
lines changed

bootloader/hal/TARGET_Freescale/TARGET_MK20DX/flash_hal.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int flash_hal_uninit(uint32_t fnc)
3939

4040
int flash_hal_erase_chip(void)
4141
{
42-
int status = flash_erase_all(&g_flash);
42+
int status = flash_erase_all(&g_flash, kFlashEraseKey);
4343
if (status == kStatus_Success)
4444
{
4545
status = flash_verify_erase_all(&g_flash, kFlashMargin_Normal);
@@ -50,7 +50,7 @@ int flash_hal_erase_chip(void)
5050

5151
int flash_hal_erase_sector(uint32_t adr)
5252
{
53-
int status = flash_erase(&g_flash, adr, g_flash.PFlashSectorSize);
53+
int status = flash_erase(&g_flash, adr, g_flash.PFlashSectorSize, kFlashEraseKey);
5454
if (status == kStatus_Success)
5555
{
5656
status = flash_verify_erase(&g_flash, adr, g_flash.PFlashSectorSize, kFlashMargin_Normal);
@@ -65,7 +65,7 @@ int flash_hal_program_page(uint32_t adr, uint32_t sz, unsigned char *buf)
6565
if (status == kStatus_Success)
6666
{
6767
status = flash_verify_program(&g_flash, adr, sz,
68-
(const uint8_t *)buf, kFlashMargin_Normal,
68+
(const uint8_t *)buf, kFlashMargin_User,
6969
NULL, NULL);
7070
}
7171
flash_cache_clear();

interface/Common/src/board.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
#include "board.h"
1717

18-
/* Each board should have a unique ID and secret. For information
18+
/* Each board should have a unique ID and secret. For information
1919
* about obtaining a secret contact support@mbed.org
2020
*/
2121
#if defined (BOARD_FRDM_KL25Z) || defined (BOARD_TWR_KL25Z48M)
@@ -54,6 +54,10 @@
5454
#define BOARD_ID "0270"
5555
#define BOARD_SECRET "xxxxxxxx"
5656

57+
#elif defined (BOARD_TWR_K24F)
58+
#define BOARD_ID "0280"
59+
#define BOARD_SECRET "xxxxxxxx"
60+
5761
#elif defined (BOARD_LPC812_MAX)
5862
#define BOARD_ID "1050"
5963
#define BOARD_SECRET "xxxxxxxx"

interface/Common/src/usbd_user_msc.c

+26-24
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
# define WANTED_SIZE_IN_KB (32)
3535
#elif defined(DBG_KL05Z)
3636
# define WANTED_SIZE_IN_KB (32)
37+
#elif defined(DBG_K24F256)
38+
# define WANTED_SIZE_IN_KB (256)
3739
#elif defined(DBG_KL25Z)
3840
# define WANTED_SIZE_IN_KB (128)
3941
#elif defined(DBG_KL26Z)
@@ -318,15 +320,15 @@ static const uint8_t root_dir1[] = {
318320
0x8E, 0x41, 0x8E, 0x41, 0x0, 0x0, 0x85, 0x75, 0x8E, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
319321

320322
// Hidden files to keep windows 8.1 happy
321-
0x42, 0x20, 0x00, 0x49, 0x00, 0x6E, 0x00, 0x66, 0x00, 0x6F, 0x00, 0x0F, 0x00, 0x72, 0x72, 0x00,
323+
0x42, 0x20, 0x00, 0x49, 0x00, 0x6E, 0x00, 0x66, 0x00, 0x6F, 0x00, 0x0F, 0x00, 0x72, 0x72, 0x00,
322324
0x6D, 0x00, 0x61, 0x00, 0x74, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x00, 0x00,
323-
324-
0x01, 0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x0F, 0x00, 0x72, 0x6D, 0x00,
325+
326+
0x01, 0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x0F, 0x00, 0x72, 0x6D, 0x00,
325327
0x20, 0x00, 0x56, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x75, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x65, 0x00,
326-
327-
0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x7E, 0x31, 0x20, 0x20, 0x20, 0x16, 0x00, 0xA5, 0x85, 0x8A,
328+
329+
0x53, 0x59, 0x53, 0x54, 0x45, 0x4D, 0x7E, 0x31, 0x20, 0x20, 0x20, 0x16, 0x00, 0xA5, 0x85, 0x8A,
328330
0x73, 0x43, 0x73, 0x43, 0x00, 0x00, 0x86, 0x8A, 0x73, 0x43, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
329-
331+
330332
// mbed html file (size 512, cluster 3)
331333
'M', 'B', 'E', 'D', 0x20, 0x20, 0x20, 0x20, 'H', 'T', 'M', 0x20, 0x18, 0xB1, 0x74, 0x76,
332334
0x8E, 0x41, 0x8E, 0x41, 0x0, 0x0, 0x8E, 0x76, 0x8E, 0x41, 0x05, 0x0, 0x00, 0x02, 0x0, 0x0,
@@ -350,30 +352,30 @@ static const uint8_t sect5[] = {
350352
};
351353

352354
static const uint8_t sect6[] = {
353-
0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x00, 0xA5, 0x85, 0x8A,
354-
0x73, 0x43, 0x73, 0x43, 0x00, 0x00, 0x86, 0x8A, 0x73, 0x43, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
355-
356-
0x2E, 0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x00, 0xA5, 0x85, 0x8A,
355+
0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x00, 0xA5, 0x85, 0x8A,
356+
0x73, 0x43, 0x73, 0x43, 0x00, 0x00, 0x86, 0x8A, 0x73, 0x43, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
357+
358+
0x2E, 0x2E, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x00, 0xA5, 0x85, 0x8A,
357359
0x73, 0x43, 0x73, 0x43, 0x00, 0x00, 0x86, 0x8A, 0x73, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
358-
360+
359361
// IndexerVolumeGuid (size0, cluster 0)
360-
0x42, 0x47, 0x00, 0x75, 0x00, 0x69, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, 0xFF, 0xFF,
362+
0x42, 0x47, 0x00, 0x75, 0x00, 0x69, 0x00, 0x64, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, 0xFF, 0xFF,
361363
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
362-
363-
0x01, 0x49, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x65, 0x00, 0x78, 0x00, 0x0F, 0x00, 0xFF, 0x65, 0x00,
364-
0x72, 0x00, 0x56, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x75, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x65, 0x00,
365-
366-
0x49, 0x4E, 0x44, 0x45, 0x58, 0x45, 0x7E, 0x31, 0x20, 0x20, 0x20, 0x20, 0x00, 0xA7, 0x85, 0x8A,
364+
365+
0x01, 0x49, 0x00, 0x6E, 0x00, 0x64, 0x00, 0x65, 0x00, 0x78, 0x00, 0x0F, 0x00, 0xFF, 0x65, 0x00,
366+
0x72, 0x00, 0x56, 0x00, 0x6F, 0x00, 0x6C, 0x00, 0x75, 0x00, 0x00, 0x00, 0x6D, 0x00, 0x65, 0x00,
367+
368+
0x49, 0x4E, 0x44, 0x45, 0x58, 0x45, 0x7E, 0x31, 0x20, 0x20, 0x20, 0x20, 0x00, 0xA7, 0x85, 0x8A,
367369
0x73, 0x43, 0x73, 0x43, 0x00, 0x00, 0x86, 0x8A, 0x73, 0x43, 0x04, 0x00, 0x4C, 0x00, 0x00, 0x00
368370
};
369371

370372
static const uint8_t sect7[] = {
371-
0x7B, 0x00, 0x39, 0x00, 0x36, 0x00, 0x36, 0x00, 0x31, 0x00, 0x39, 0x00, 0x38, 0x00, 0x32, 0x00,
372-
0x30, 0x00, 0x2D, 0x00, 0x37, 0x00, 0x37, 0x00, 0x44, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x34, 0x00,
373-
0x46, 0x00, 0x38, 0x00, 0x38, 0x00, 0x2D, 0x00, 0x38, 0x00, 0x46, 0x00, 0x35, 0x00, 0x33, 0x00,
374-
0x2D, 0x00, 0x36, 0x00, 0x32, 0x00, 0x44, 0x00, 0x39, 0x00, 0x37, 0x00, 0x46, 0x00, 0x35, 0x00,
373+
0x7B, 0x00, 0x39, 0x00, 0x36, 0x00, 0x36, 0x00, 0x31, 0x00, 0x39, 0x00, 0x38, 0x00, 0x32, 0x00,
374+
0x30, 0x00, 0x2D, 0x00, 0x37, 0x00, 0x37, 0x00, 0x44, 0x00, 0x31, 0x00, 0x2D, 0x00, 0x34, 0x00,
375+
0x46, 0x00, 0x38, 0x00, 0x38, 0x00, 0x2D, 0x00, 0x38, 0x00, 0x46, 0x00, 0x35, 0x00, 0x33, 0x00,
376+
0x2D, 0x00, 0x36, 0x00, 0x32, 0x00, 0x44, 0x00, 0x39, 0x00, 0x37, 0x00, 0x46, 0x00, 0x35, 0x00,
375377
0x46, 0x00, 0x34, 0x00, 0x46, 0x00, 0x46, 0x00, 0x39, 0x00, 0x7D, 0x00, 0x00, 0x00, 0x00, 0x00
376-
};
378+
};
377379

378380
SECTOR sectors[] = {
379381
/* Reserved Sectors: Master Boot Record */
@@ -557,9 +559,9 @@ static void initDisconnect(uint8_t success) {
557559
int autocrp = (good_file == 3) && success;
558560
if (autocrp)
559561
{
560-
// first we need to discoonect the usb stack
562+
// first we need to discoonect the usb stack
561563
usbd_connect(0);
562-
564+
563565
enter_isp();
564566
}
565567
#else

0 commit comments

Comments
 (0)