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

use all spi flash v0.1 #2638

Merged
merged 6 commits into from
Nov 18, 2024
Merged

Conversation

ANTodorov
Copy link
Contributor

  • introduced a new communication command CMD_FLASHMEM_PAGES64K to get the number of 64k pages
  • "the last page" is a special, holding the dicts and some other stuff, relocated to there
  • raised timeout when wiping a mem page (W25Q16 looks a bit slower than W25X20BV)
  • loop all pages in Flash_WipeMemory()

* introduced a new communication command CMD_FLASHMEM_PAGES64K to get the number of 64k pages
* "the last page" is a special, holding the dicts and some other stuff, relocated to there
* raised timeout when wiping a mem page (W25Q16 looks a bit slower than W25X20BV)
* loop all pages in Flash_WipeMemory()
if (flash_init) {
if (!FlashInit()) {
if (g_dbglevel > 3) Dbprintf("FlashDetect() FlashInit fail");
return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't mix return codes.

@@ -471,6 +500,12 @@ bool FlashInit(void) {
return false;
}

#ifndef AS_BOOTROM
if (spi_flash_p64k == 0){
if (!FlashDetect(false)) return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

use same style with Curly Brackets

@@ -37,10 +37,16 @@
#ifndef FLASH_MEM_MAX_SIZE
# define FLASH_MEM_MAX_SIZE 0x40000 // (262144)
#endif
#ifndef FLASH_MEM_MAX_SIZE_P
# define FLASH_MEM_MAX_SIZE_P(p64k) (1024 * 64 * p64k)
Copy link
Collaborator

Choose a reason for hiding this comment

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

use extra parenthesis around params in defines. ie: (1024 * 64 * (p64k))

@iceman1001
Copy link
Collaborator

Nice PR! with some minor things to sort out.

@iceman1001
Copy link
Collaborator

the only thing left is how we transition from old to new seamless...

Everyone with a rdv4 would need to "re-wipe" their spiffs and run init script to make it work?

@ANTodorov
Copy link
Contributor Author

ANTodorov commented Nov 17, 2024

Just checked with my RDV4. It is with 256k spi flash, so no change - all offsets are same even the signature check is OK:
image
(tested t55xx with password too, no problem using the dict from the flash)

For the PM3 Easy's with the 2MB spi flash there will be a need to wipe page 0..3 - the "old" format and re-upload the dictionaries. But I believe the owners that had built PM3GENERIC+FLASH are enough tech competent to do the migration...

Edit: uploaded smaller picture, not sure how sensitive is the signature data, even partial...

@ANTodorov
Copy link
Contributor Author

Hmm in the updated version the re is no "protection". I think I should update the page wiping boundaries in the code... just e second

  • to erase it:
    • Beware it will erase your flash signature so better to back it up first as you won't be able to regenerate it by yourself!
    • edit the source code to enable Page 3 as a valid input in the mem wipe command.
    • Updating keys dictionaries doesn't require to erase page 3.

@iceman1001 iceman1001 merged commit 52c46db into RfidResearchGroup:master Nov 18, 2024
12 checks passed
@iceman1001
Copy link
Collaborator

Awesome!

Now some people can make really long traces and save a lot of files when in standalone mode :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants