Skip to content

Commit 8783956

Browse files
0xc0170maciejbocianski
authored andcommitted
QSPI STM32: fix prepare comman - alt/address
1 parent fff2072 commit 8783956

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

targets/TARGET_STM/qspi_api.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ void qspi_prepare_command(const qspi_command_t *command, QSPI_CommandTypeDef *st
7878

7979
if (command->address.disabled == true) {
8080
st_command->AddressMode = QSPI_ADDRESS_NONE;
81+
st_command->AddressSize = 0;
82+
} else {
83+
st_command->Address = command->address.value;
84+
st_command->AddressSize = command->address.size;
8185
}
8286

8387
switch (command->alt.bus_width) {
@@ -97,6 +101,10 @@ void qspi_prepare_command(const qspi_command_t *command, QSPI_CommandTypeDef *st
97101

98102
if (command->alt.disabled == true) {
99103
st_command->AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
104+
st_command->AlternateBytesSize = 0;
105+
} else {
106+
st_command->AlternateBytes = command->alt.value;
107+
st_command->AlternateBytesSize = command->alt.size;
100108
}
101109

102110
switch (command->data.bus_width) {
@@ -113,6 +121,8 @@ void qspi_prepare_command(const qspi_command_t *command, QSPI_CommandTypeDef *st
113121
st_command->DataMode = QSPI_DATA_NONE;
114122
break;
115123
}
124+
125+
st_command->NbData = 0;
116126
}
117127

118128

0 commit comments

Comments
 (0)