Memory-mapped flash on F7 and H7

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Memory-mapped flash on F7 and H7

Postby Giovanni » Sat Feb 20, 2021 8:36 pm

I took it from the F7 code.

Code: Select all

RCC_AHB3ENR_QSPIEN | RCC_AHB3RSTR_QSPIRST


Note that you are mixing constants of 2 different registers here.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Memory-mapped flash on F7 and H7

Postby andypiper » Sat Feb 20, 2021 10:00 pm

Giovanni wrote:I took it from the F7 code.

Code: Select all

RCC_AHB3ENR_QSPIEN | RCC_AHB3RSTR_QSPIRST


Note that you are mixing constants of 2 different registers here.

Giovanni


I wondered about that, but isn't this the same?

Code: Select all

  rccResetAHB4(~(RCC_APB4RSTR_SYSCFGRST | STM32_GPIO_EN_MASK));

?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Memory-mapped flash on F7 and H7

Postby Giovanni » Sat Feb 20, 2021 10:29 pm

andypiper wrote:

Code: Select all

  rccResetAHB4(~(RCC_APB4RSTR_SYSCFGRST | STM32_GPIO_EN_MASK));

?


STM32_GPIO_EN_MASK is used for both enabling and resetting, it relies on registers having bits in same position. If you use ST header definitions then better use the correct ones.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Memory-mapped flash on F7 and H7

Postby andypiper » Sun May 16, 2021 4:31 pm

I've started on this again, but using a Nucleo H743 board with a breakout so that I can debug. The flash chip I want to support is W25Q128JV is this the same chip as supported by the N25Q serial nor driver? Or do I have to write my own?

The reason I ask is the driver hangs in snorStart() for me.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Memory-mapped flash on F7 and H7

Postby Giovanni » Sun May 16, 2021 4:53 pm

Hi,

It is different, a new mini-driver is required.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Memory-mapped flash on F7 and H7

Postby andypiper » Tue May 18, 2021 8:06 am

Giovanni wrote:Hi,

It is different, a new mini-driver is required.

Giovanni


Hi so I have written the mini driver. Now I see that I am missing the wiring of the QUADSPI pin functions into the driver. I am struggling to find an example of how to set this up, can you point me at it? I would have thought it would go in here
const WSPIConfig WSPIcfg1 = {
.end_cb = NULL,
.error_cb = NULL,
.dcr = STM32_DCR_FSIZE(24U) | /* 16MB device. */
STM32_DCR_CSHT(1U) /* NCS 2 cycles delay. */
};

but doesn't seem to be
Thanks
andy

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Memory-mapped flash on F7 and H7

Postby Giovanni » Tue May 18, 2021 9:06 am

Sorry, I don't understand your question.

Giovanni

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Memory-mapped flash on F7 and H7

Postby andypiper » Tue May 18, 2021 9:53 am

Giovanni wrote:Sorry, I don't understand your question.

Giovanni


On the H7 there are certain pins that can be mapped to QUADSPI - how do I specify which pins those are to the wspi driver? There are at least two possibilities on H7

steved
Posts: 823
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 135 times

Re: Memory-mapped flash on F7 and H7

Postby steved » Tue May 18, 2021 1:07 pm

Your driver talks to the WSPI peripheral, which is a fixed entity (OK, maybe there are two, as with serial ports, but same principle).

The board setup file then links the required pins with the WSPI peripheral.

andypiper
Posts: 65
Joined: Sat Oct 24, 2020 5:21 pm
Has thanked: 5 times
Been thanked: 4 times

Re: Memory-mapped flash on F7 and H7

Postby andypiper » Tue May 18, 2021 1:14 pm

steved wrote:Your driver talks to the WSPI peripheral, which is a fixed entity (OK, maybe there are two, as with serial ports, but same principle).

The board setup file then links the required pins with the WSPI peripheral.


Its the board setup file I am missing in this case - can you point me at an example?


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 20 guests