Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/kinetis: add flashpage for W & K series #11422

Merged
merged 1 commit into from
Jan 3, 2020

Conversation

fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas commented Apr 19, 2019

Contribution description

This PR adds an initial flashpage and flashpage raw implementation for Kinetis K & W series

Testing procedure

Tested on frdm-fw41z and pba-d-01-kw2x for W series. To test run:

make -C tests/periph_flashpage/ BOARD=pba-d-01-kw2x flash test

Need Help testing on K series Implementation is exactly the same for K series but I don't have a board to test, maybe someone has frdm-k64f to test?

Issues/PRs references

This pr depends on #11424 #11477.

@fjmolinas fjmolinas changed the title Pr kinetis w flashpage cpu/kinetis: add flashpage for W & K series Apr 19, 2019
@fjmolinas fjmolinas added Area: drivers Area: Device drivers State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Apr 19, 2019
@fjmolinas fjmolinas requested a review from aabadie April 19, 2019 09:28
@fjmolinas fjmolinas force-pushed the pr_kinetis_w_flashpage branch 2 times, most recently from 30a76d9 to 7db9a8f Compare April 19, 2019 10:27
@fjmolinas
Copy link
Contributor Author

Since #11424 was closed this PR will need to wait for #11477.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Tested with success on usb-kw41z !

cpu/kinetis/include/cpu_conf_kinetis_w.h Outdated Show resolved Hide resolved
@fjmolinas fjmolinas force-pushed the pr_kinetis_w_flashpage branch from 7db9a8f to d14b0ee Compare June 15, 2019 19:23
@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Dec 18, 2019
@fjmolinas fjmolinas removed the State: stale State: The issue / PR has no activity for >185 days label Dec 18, 2019
@fjmolinas fjmolinas force-pushed the pr_kinetis_w_flashpage branch 2 times, most recently from 54539ed to 8b8467d Compare December 20, 2019 15:31
@fjmolinas fjmolinas removed the State: waiting for other PR State: The PR requires another PR to be merged first label Dec 20, 2019
@fjmolinas fjmolinas force-pushed the pr_kinetis_w_flashpage branch 2 times, most recently from 4ccbced to 199ec2c Compare December 20, 2019 16:36
@fjmolinas
Copy link
Contributor Author

fjmolinas commented Dec 20, 2019

@aabadie this one is ready for review now.

TRIBE_CI=1 BOARD=frdm-kw41z make -C tests/periph_flashpage/ flash test -j3
2019-12-20 16:34:38,829 # Connect to serial port /dev/riot/tty-frdm-kw41z
Welcome to pyterm!
Type '/exit' to exit.
2019-12-20 16:34:39,834 # o start test, r to print it is ready
2019-12-20 16:34:39,836 # Help: Press s to start test, r to print it is ready
2019-12-20 16:34:39,839 # READY
s
2019-12-20 16:34:39,914 # START

2019-12-20 16:34:39,920 # main(): This is RIOT! (Version: 2020.01-devel-1492-g4ccbc-pr_kinetis_w_flashpage)
2019-12-20 16:34:39,924 # ROM flash read write test
2019-12-20 16:34:39,925 # 
2019-12-20 16:34:39,931 # Please refer to the README.md for further information
2019-12-20 16:34:39,931 # 
2019-12-20 16:34:39,932 # Flash start addr:     0x00000000
2019-12-20 16:34:39,932 # Page size:            2048
2019-12-20 16:34:39,935 # Number of pages:      256
> 2019-12-20 16:34:39,935 #  
> test_last
2019-12-20 16:34:39,995 #  s
2019-12-20 16:34:39,996 # shell: command not found: s
> 2019-12-20 16:34:40,045 #  test_last
2019-12-20 16:34:40,085 # wrote local page buffer to last flash page
> help
2019-12-20 16:34:40,165 #  help
2019-12-20 16:34:40,167 # Command              Description
2019-12-20 16:34:40,171 # ---------------------------------------
2019-12-20 16:34:40,176 # info                 Show information about pages
2019-12-20 16:34:40,181 # dump                 Dump the selected page to STDOUT
2019-12-20 16:34:40,186 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 16:34:40,196 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 16:34:40,199 # write                Write the local page buffer to the given page
2019-12-20 16:34:40,206 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 16:34:40,210 # erase                Erase the given page buffer
2019-12-20 16:34:40,216 # edit                 Write bytes to the local page buffer
2019-12-20 16:34:40,217 # test                 Write and verify test pattern
2019-12-20 16:34:40,226 # test_last            Write and verify test pattern on last page available
2019-12-20 16:34:40,231 # test_last_raw        Write and verify raw short write on last page available
> test_last_raw
2019-12-20 16:34:40,306 #  test_last_raw
2019-12-20 16:34:40,321 # wrote raw short buffer to last flash page
> help
2019-12-20 16:34:40,396 #  help
2019-12-20 16:34:40,397 # Command              Description
2019-12-20 16:34:40,402 # ---------------------------------------
2019-12-20 16:34:40,407 # info                 Show information about pages
2019-12-20 16:34:40,412 # dump                 Dump the selected page to STDOUT
2019-12-20 16:34:40,417 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 16:34:40,424 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 16:34:40,428 # write                Write the local page buffer to the given page
2019-12-20 16:34:40,437 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 16:34:40,442 # erase                Erase the given page buffer
2019-12-20 16:34:40,446 # edit                 Write bytes to the local page buffer
2019-12-20 16:34:40,449 # test                 Write and verify test pattern
2019-12-20 16:34:40,457 # test_last            Write and verify test pattern on last page available
2019-12-20 16:34:40,467 # test_last_raw        Write and verify raw short write on last page available
> 
TRIBE_CI=1 BOARD=frdm-k64f make -C tests/periph_flashpage/ flash test -j3
2019-12-20 16:36:44,664 # Connect to serial port /dev/riot/tty-frdm-k64f
Welcome to pyterm!
Type '/exit' to exit.
2019-12-20 16:36:45,669 # READY
s
2019-12-20 16:36:45,743 # START

2019-12-20 16:36:45,750 # main(): This is RIOT! (Version: 2020.01-devel-1492-g4ccbc-pr_kinetis_w_flashpage)
2019-12-20 16:36:45,753 # ROM flash read write test
2019-12-20 16:36:45,753 # 
2019-12-20 16:36:45,757 # Please refer to the README.md for further information
2019-12-20 16:36:45,758 # 
2019-12-20 16:36:45,760 # Flash start addr:     0x00000000
2019-12-20 16:36:45,761 # Page size:            4096
2019-12-20 16:36:45,763 # Number of pages:      256
> 2019-12-20 16:36:45,764 #  
> test_last
2019-12-20 16:36:45,809 #  s
2019-12-20 16:36:45,812 # shell: command not found: s
> 2019-12-20 16:36:45,865 #  test_last
2019-12-20 16:36:45,916 # wrote local page buffer to last flash page
> help
2019-12-20 16:36:45,990 #  help
2019-12-20 16:36:45,993 # Command              Description
2019-12-20 16:36:45,996 # ---------------------------------------
2019-12-20 16:36:46,000 # info                 Show information about pages
2019-12-20 16:36:46,005 # dump                 Dump the selected page to STDOUT
2019-12-20 16:36:46,010 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 16:36:46,018 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 16:36:46,024 # write                Write the local page buffer to the given page
2019-12-20 16:36:46,030 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 16:36:46,034 # erase                Erase the given page buffer
2019-12-20 16:36:46,039 # edit                 Write bytes to the local page buffer
2019-12-20 16:36:46,043 # test                 Write and verify test pattern
2019-12-20 16:36:46,050 # test_last            Write and verify test pattern on last page available
2019-12-20 16:36:46,056 # test_last_raw        Write and verify raw short write on last page available
> test_last_raw
2019-12-20 16:36:46,125 #  test_last_raw
2019-12-20 16:36:46,135 # wrote raw short buffer to last flash page
> help
2019-12-20 16:36:46,202 #  help
2019-12-20 16:36:46,205 # Command              Description
2019-12-20 16:36:46,208 # ---------------------------------------
2019-12-20 16:36:46,213 # info                 Show information about pages
2019-12-20 16:36:46,217 # dump                 Dump the selected page to STDOUT
2019-12-20 16:36:46,223 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 16:36:46,230 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 16:36:46,236 # write                Write the local page buffer to the given page
2019-12-20 16:36:46,242 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 16:36:46,246 # erase                Erase the given page buffer
2019-12-20 16:36:46,251 # edit                 Write bytes to the local page buffer
2019-12-20 16:36:46,256 # test                 Write and verify test pattern
2019-12-20 16:36:46,262 # test_last            Write and verify test pattern on last page available
2019-12-20 16:36:46,268 # test_last_raw        Write and verify raw short write on last page available
>

TRIBE_CI=1 BOARD=pba-d-01-kw2x make -C tests/periph_flashpage/ flash test -j3
2019-12-20 17:37:26,285 # Connect to serial port /dev/riot/tty-pba-d-01-kw2x
Welcome to pyterm!
Type '/exit' to exit.
2019-12-20 17:37:27,439 # READY
s
2019-12-20 17:37:27,507 # START

2019-12-20 17:37:27,514 # main(): This is RIOT! (Version: 2020.01-devel-1492-g199ec-pr_kinetis_w_flashpage)
2019-12-20 17:37:27,516 # ROM flash read write test
2019-12-20 17:37:27,516 # 
2019-12-20 17:37:27,520 # Please refer to the README.md for further information
2019-12-20 17:37:27,521 # 
2019-12-20 17:37:27,523 # Flash start addr:     0x00000000
2019-12-20 17:37:27,524 # Page size:            2048
2019-12-20 17:37:27,526 # Number of pages:      128
> 2019-12-20 17:37:27,527 #  
> test_last
2019-12-20 17:37:27,573 #  s
2019-12-20 17:37:27,576 # shell: command not found: s
> 2019-12-20 17:37:27,625 #  test_last
2019-12-20 17:37:27,675 # wrote local page buffer to last flash page
> help
2019-12-20 17:37:27,743 #  help
2019-12-20 17:37:27,746 # Command              Description
2019-12-20 17:37:27,749 # ---------------------------------------
2019-12-20 17:37:27,753 # info                 Show information about pages
2019-12-20 17:37:27,758 # dump                 Dump the selected page to STDOUT
2019-12-20 17:37:27,763 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 17:37:27,770 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 17:37:27,776 # write                Write the local page buffer to the given page
2019-12-20 17:37:27,782 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 17:37:27,786 # erase                Erase the given page buffer
2019-12-20 17:37:27,791 # edit                 Write bytes to the local page buffer
2019-12-20 17:37:27,796 # test                 Write and verify test pattern
2019-12-20 17:37:27,802 # test_last            Write and verify test pattern on last page available
2019-12-20 17:37:27,809 # test_last_raw        Write and verify raw short write on last page available
> test_last_raw
2019-12-20 17:37:27,877 #  test_last_raw
2019-12-20 17:37:27,886 # wrote raw short buffer to last flash page
> help
2019-12-20 17:37:27,955 #  help
2019-12-20 17:37:27,958 # Command              Description
2019-12-20 17:37:27,962 # ---------------------------------------
2019-12-20 17:37:27,966 # info                 Show information about pages
2019-12-20 17:37:27,970 # dump                 Dump the selected page to STDOUT
2019-12-20 17:37:27,976 # dump_local           Dump the local page buffer to STDOUT
2019-12-20 17:37:27,983 # read                 Copy the given page to the local page buffer and dump to STDOUT
2019-12-20 17:37:27,989 # write                Write the local page buffer to the given page
2019-12-20 17:37:27,995 # write_raw            Write (ASCII, max 64B) data to the given address
2019-12-20 17:37:27,999 # erase                Erase the given page buffer
2019-12-20 17:37:28,004 # edit                 Write bytes to the local page buffer
2019-12-20 17:37:28,009 # test                 Write and verify test pattern
2019-12-20 17:37:28,015 # test_last            Write and verify test pattern on last page available
2019-12-20 17:37:28,022 # test_last_raw        Write and verify raw short write on last page available
> 
make: Leaving directory '/home/francisco/workspace/RIOT/tests/periph_flashpage'

@fjmolinas
Copy link
Contributor Author

@aabadie addressed typos.

#include "periph/flashpage.h"

/**
* @brief FLash controller commands
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still flash with capital L

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now and it was already successfully tested.

ACK, please squash!

@fjmolinas fjmolinas force-pushed the pr_kinetis_w_flashpage branch from f95d794 to 7d11e40 Compare January 3, 2020 08:57
@fjmolinas fjmolinas added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 3, 2020
@aabadie aabadie merged commit e45dc52 into RIOT-OS:master Jan 3, 2020
@fjmolinas fjmolinas deleted the pr_kinetis_w_flashpage branch January 6, 2020 12:45
@fjmolinas fjmolinas added this to the Release 2020.01 milestone Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants