-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Note: This is just a template, so feel free to use/remove the unnecessary things
Description
- Type: Bug
- Priority: Blocker
Bug
Target
UBLOX_EVK_ODIN_W2
Toolchain:
GCC_ARM
Toolchain version:
5.4.1 20160919
mbed-cli version:
1.2.0
mbed-os sha:
(git log -n1 --oneline
)
mbed-os-5.6.0
5499db1 Merge pull request #5178 from ARMmbed/release-candidate
Expected behavior
UBLOX_EVK_ODIN_W2's SPI should perform same as K64F's SPI.
Actual behavior
UBLOX_EVK_ODIN_W2 does not return the same value as K64F.
Steps to reproduce
- Have SPI component like LSM9DS0.
- Connect SPI pins.
- Run who_am_i check program like below.
#include "mbed.h"
//set up spi
//MOSI is PTC6
//MISO is PTC7
//SCLK is PTC5
//gyro chip select is PTC0
SPI spi(D11, D12, D13); // andrewc
DigitalOut gyroCSPin(D5); // andrewc
int main() {
gyroCSPin = 1;
//SPI Mode is 0
spi.format(8, 0);
spi.frequency(80000);
for (int i = 0; i < 0x100; i++)
{
printf("Trying for %d\n", i);
//Code steps:
//A) Test if we're connected with the gyroscope
// i) Read the "who am I" register (address code: 143) and check if gyroscope responds (the id register value should be 212).
gyroCSPin = 0;
spi.write(i);
int who_am_i_value = spi.write(0);
wait_us(3);
gyroCSPin = 1;
if (who_am_i_value != 0xFF) {
printf("Gyroscope is working! val = %d\n", who_am_i_value);
} else {
printf("Gyroscope is not working! val = %d\n", who_am_i_value);
}
}
}
Hi, @andreaslarssonublox and @andreaspeterssonublox
Could you please give me an advice how to enable SPI from UBLOX_EVK_ODIN_W2?
Do you have working example code with UBLOX_EVK_ODIN_W2?
Somehow, SPI does not seems to work well like other EVK such as K64F.
Thanks,
Metadata
Metadata
Assignees
Labels
No labels