Hi,
I am using the nrf52dk_nrf52832 board and adding a peripheral SPI Flash. I had previously gotten the SPI Flash to work but now it does not.
I've hooked it up to the oscilloscope and determined that my CLK is likely the problem.
I can see the CS and and the MOSI line perfectly but the CLK alternates between 0 V and 1.02V which I believe is too low for the device to recognize.
I am using pin 28 as the CLK which, again, did at one point work; I have switch which pin I am using to no avail.
I have attached my overlay and my initialization functions - I am using the Zephyr drivers and attached an example command.
All help is appreciated,
Tom
void releasePowerDown(void){
// Set up the buffers
uint8_t tx_buffer[5];
tx_buffer[0] = 0xab;
for(int i = 1; i < 5; i ++){
tx_buffer[i] = 0x00;
}
uint8_t rx_buffer[5];
const struct spi_buf tx_buf = {
.buf = tx_buffer,
.len = sizeof(tx_buffer)
};
const struct spi_buf_set tx = {
.buffers = &tx_buf,
.count = 1
};
struct spi_buf rx_buf = {
.buf = rx_buffer,
.len = sizeof(rx_buffer),
};
const struct spi_buf_set rx = {
.buffers = &rx_buf,
.count = 1
};
int err;
err = spi_transceive(spi_dev, &spi_cfg, &tx, &rx);
if(err){
printk("SPI transceive fail: %i. Release power down.\n", err);
}
printk("Release Power Down RX recv: ");
for(int i = 0; i < 5; i ++){
printk("%X ", rx_buffer[i]);
}
printk("\r\n");
}&spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
sck-pin = <28>;
mosi-pin = <30>;
miso-pin = <31>;
cs-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
w25: w25q32@0 {
compatible = "winbond,w25q32", "jedec,spi-nor";
label = "W25Q32";
reg = <0>;
jedec-id = [ef 40 14];
size = <0x4000000>;
// Can be up to 45000000
spi-max-frequency = <5000000>;
wp-gpios = < &gpio0 4 GPIO_ACTIVE_LOW >;
hold-gpios = < &gpio0 3 GPIO_ACTIVE_LOW >;
// reset-gpios = < &gpio0 5 GPIO_ACTIVE_LOW >;
};
};
&radio{
status = "disabled";
};
&i2c0{
status = "disabled";
};
&adc{
status = "disabled";
};
&temp{
status = "disabled";
};
&rng{
status = "disabled";
};
&wdt{
status = "disabled";
};
&spi2{
status = "disabled";
};
&pwm0{
status = "disabled";
};