Test and example code suggestion.
Posted: Wed Jun 03, 2020 11:59 am
In most of the examples the start of the serial port looks like this:
sometimes the comment says that this will result in 38400-8-n-1 configuration (but most often not). That's all fine and dandy, but the code is also meant to be an example you can start from and start to modify.
In the same vein I think there should be
Code: Select all
sdStart(&SD1, NULL);
sometimes the comment says that this will result in 38400-8-n-1 configuration (but most often not). That's all fine and dandy, but the code is also meant to be an example you can start from and start to modify.
Code: Select all
/*
* This is the configuration for the serial port. The current configuration here is also
* the default, so instead of passing this structure passin "NULL" would also result in the same configuration.
*/
static SerialConfig ser_cfg = {
38400,
0,
0,
0,
};
...
sdStart(&SD1, &ser_cfg);
In the same vein I think there should be
Code: Select all
/* because we use the DISCOVERY board definition and that configures the default to be
* correct in this case this is not necessary. But if you want to use it on a different UART/pin
* this is how it is done.
*/
palSetLinemode (...., STM_ALTERNATE ());