W25 Flash ( STM32F411 )

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Alan_37
Posts: 173
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Flowcode v10 W25 Flash ( STM32F411 )

Post by Alan_37 »

Hi I am trying to use W25q32 Serial Flash but there seems to be more then 1 Bug in it .

I can read data properly from it when programmed with a Programmer, but I can not write to it
proper data using SPI with STM32f411.

Bug 1 : Erase Block if I set it to start erasing from Page 5 , it will start from Page 0 anyways
Bug 2 : Write Data Array , will write different data then it was suppose to
Bug 3 : Write Data Bytes , Dose not work at all

Write Protect Pin is Active Low so I connected it to +3.3v

Also using Hardware Channel SPI and Software mode produces different results

I have included a fcfx file to test with . the following is what I get when reading Page 0

SPI Software mode :

Code: Select all

    00 02 03 04 05 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   .....ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff                           ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ         
SPI Hardware Mode

Code: Select all

    00 02 03 04 05 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   .....ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 02   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.. 
    03 04 05 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ...ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff                           ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
Attachments
W25.fcfx
(17.07 KiB) Downloaded 400 times

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Can this be fixed please ?

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Flowcode v10 Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Hello

Any news on this Bug please ?

I am stuck , can not continue the project without this

BenR
Matrix Staff
Posts: 1895
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 491 times
Been thanked: 664 times

Re: W25 Flash ( STM32F411 )

Post by BenR »

Hello,

First of all can you confirm the delays in your program are correct using a 1 second flasher test?
https://www.flowcode.co.uk/wiki/index.p ... ED_flasher

Next you may want to try a larger prescaler for the SPI to help slow it down a bit, just in case it's running too fast.

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Hi BenR

Thanks for your reply

I will do that today and let you know

Thanks again

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Hi so here are the results

I have set the prescaler to 16 , 32 and 64 result still the same
I also tried to lower the speed from the RCC register but still no joy .

Delays seems to be perfect I made a 50ms Blinking on C13
photo_2024-04-29_18-22-03.jpg
photo_2024-04-29_18-22-03.jpg (65.72 KiB) Viewed 4041 times

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Update :)

I have replaced the W25 flash to 128Mb, shortened the wires as possible and added a 0.1uf decupling capacitor .

Now I see some improvement, Write Data Array works properly if I start writing from address 1
Address 0 remains 00 for some reason can not write to it .

Also this works only in SPI software mode Prescale /16 , Hardware dose not work .

Write Data Bytes still dose not work at all

Code: Select all

[30/04/2024 07:26:25] Read data (COM22) 
    00 01 02 03 04 05 06 07 08 ff ff ff ff ff ff ff ff ff ff ff ff ff   .........ÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ 
    ff ff ff ff ff ff ff ff ff ff ff ff                                 ÿÿÿÿÿÿÿÿÿÿÿÿ           

Alan_37
Posts: 173
Joined: Thu Dec 03, 2020 7:23 pm
Has thanked: 52 times
Been thanked: 25 times

Re: W25 Flash ( STM32F411 )

Post by Alan_37 »

Hello here is another update

I was able to make , Write Data Bytes to work

I have to admit it was from my side , I was putting write control =1 before entering the loop
it needed to be in the loop and executed every time before a byte is written.

That is why was not working :?

Can move this to general after all was not a Bug .

Code: Select all

[30/04/2024 22:31:37] Read data (COM22) 
    00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15   ...................... 
    16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b   .......... !"#$%&'()*+ 
    2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41   ,-./0123456789:;<=>?@A 
    42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57   BCDEFGHIJKLMNOPQRSTUVW 
    58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d   XYZ[\]^_`abcdefghijklm 
    6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83   nopqrstuvwxyz{|}~€‚ƒ 
    84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99   „…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™ 
    9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af   š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯ 
    b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5   °±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅ 
    c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db   ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛ 
    dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1   ÜÝÞßàáâãäåæçèéêëìíîïðñ 
    f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff                           òóôõö÷øùúûüýþÿ         

Post Reply