Skip to content
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

Merged
merged 10 commits into from
Jan 24, 2024
Merged

SPI Validation #241

merged 10 commits into from
Jan 24, 2024

Conversation

mitchellostler
Copy link
Collaborator

No description provided.

@@ -241,6 +241,11 @@ if PLATFORM == 'arm' and TYPE == 'project':

# flash the MCU using openocd
def flash_run(target, source, env):
import serial
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator

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

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);
Copy link
Collaborator Author

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
Copy link
Collaborator

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));
Copy link
Collaborator

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?

@ShiCheng-Lu ShiCheng-Lu merged commit 18223ae into main Jan 24, 2024
1 check passed
@ShiCheng-Lu ShiCheng-Lu deleted the mci_validation branch January 24, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants