Skip to content

Commit

Permalink
docs: Update porting documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrossard committed Feb 13, 2024
1 parent 680412f commit ad022ca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 6 additions & 3 deletions docs/PORT_BOARD.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This assumes there is already target support present in the codebase. If adding
* @brief board_info api for my board
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2021, Arm Limited, All Rights Reserved
* Copyright (c) 2009-2023, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand All @@ -49,10 +49,13 @@ This assumes there is already target support present in the codebase. If adding
extern target_cfg_t target_device_nrf51822_16;
const board_info_t g_board_info = {
.board_id = "0x240",
.family_id = kStub_HWReset_FamilyID,
.info_version = kBoardInfoVersion,
.board_id = "9999",
.family_id = kNordic_Nrf51_FamilyID,
.flags = kEnablePageErase|kEnableUnderResetConnect,
.target_cfg = &target_device_nrf51822_16,
.board_vendor = "Vendor Name",
.board_name = "My Board Name",
};
```
The complete fields of board_info api with description is in `source/target/target_board.h`.
Expand Down
10 changes: 6 additions & 4 deletions docs/PORT_TARGET_FAMILY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Adding new target family support requires creating a flash algo blob and the imp
* @brief Target reset for the new target
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* Copyright (c) 2009-2023, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down Expand Up @@ -70,15 +70,15 @@ const target_family_descriptor_t g_target_family = {
The target family api is located in `source/target/target_family.h` and target_reset file can customize the function apis according to the family specification. Family id is a combination of vendor id and an incrementing id. There are predefined family id stubs that can be used for generic reset types; `kStub_HWReset_FamilyID`, `kStub_SWVectReset_FamilyID`, and `kStub_SWSysReset_FamilyID`.
A flash algorithm blob is needed to program the target MCUs internal (or external) flash memory. This blob contains position independent functions for erasing, reading and writing to the flash controller. Flash algorithm blobs are created from the [FlashAlgo project.](https://github.com/pyocd/FlashAlgo). An example blob is shown below and would be added to `source/family/<mfg>/<targetname>/flash_blob.c`
A flash algorithm blob is needed to program the target MCUs internal (or external) flash memory. This blob contains position independent functions for erasing, reading and writing to the flash controller. Flash algorithm blobs are created from the [FlashAlgo project.](https://github.com/pyocd/FlashAlgo). Use the `tools/generate_flash_algo.py` script to generate the `flash_blob.c` source file for the target (use the `--pack-path` if the flash algo originates from a CMSIS Pack). An example blob is shown below and would be added to `source/family/<mfg>/<targetname>/flash_blob.c`:
```c
/**
* @file flash_blob.c
* @brief Flash algorithm for the new target MCU
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* Copyright (c) 2009-2023, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down Expand Up @@ -144,7 +144,7 @@ The last required file is the target MCU description file `source/family/<mfg>/<
* @brief Target information for the target MCU
*
* DAPLink Interface Firmware
* Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
* Copyright (c) 2009-2023, Arm Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
Expand Down Expand Up @@ -175,6 +175,8 @@ target_cfg_t target_device = {
.flash_regions[0].flash_algo = (program_target_t *) &flash,
.ram_regions[0].start = 0x1fff0000,
.ram_regions[0].end = 0x20030000,
.target_vendor = "NXP",
.target_part_number = "MK66FN2M0VMD18",
};
```

Expand Down

0 comments on commit ad022ca

Please sign in to comment.