-
Notifications
You must be signed in to change notification settings - Fork 4
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
SPI Validation #241
SPI Validation #241
Conversation
@@ -241,6 +241,11 @@ if PLATFORM == 'arm' and TYPE == 'project': | |||
|
|||
# flash the MCU using openocd | |||
def flash_run(target, source, env): | |||
import serial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to merge this one in, but this check for the serial path will prevent macs from flashing. We can add a
import platform
if platform.system() == 'Darwin':
# check for /dev/tty.usbmodem* device
else:
# check for /dev/serial/
And that should resolve. Unfortunately I don't have a dongle, so I can't test at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also move this to another PR if you like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just add this in
libraries/ms-common/src/arm/spi.c
Outdated
SPI_I2S_ITConfig(s_port[spi].base, SPI_I2S_IT_ERR | SPI_I2S_IT_TXE, ENABLE); | ||
SPI_Cmd(s_port[spi].base, ENABLE); | ||
// set spi CS state LOW | ||
gpio_set_state(&s_port[spi].cs, GPIO_STATE_LOW); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- SPI_Cmd(s_port[spi].base, ENABLE);
- // set spi CS state LOW
- gpio_set_state(&s_port[spi].cs, GPIO_STATE_LOW);
I had to change it to this on my branch so that the spi cmd happens before the pin state gets set to get the correct behaviour for the CS pin
@@ -241,6 +241,11 @@ if PLATFORM == 'arm' and TYPE == 'project': | |||
|
|||
# flash the MCU using openocd | |||
def flash_run(target, source, env): | |||
import serial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just add this in
@@ -49,9 +49,7 @@ StatusCode mppt_init(const SpiSettings *settings, const SpiPort port) { | |||
status_ok_or_return(prv_select_mppt(i)); | |||
|
|||
// Turning on MPPT | |||
status_ok_or_return(spi_cs_set_state(mppt_spi_port, GPIO_STATE_LOW)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we just want to get rid of any unneeded changes?
No description provided.