CY8CPROTO-062-4343W - SPI Flash error without thermistor portion

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiCr_4063401
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Hi guys,

I'm working with the CY8CPROTO-062-4343W board, and I've noticed a few issues:

1.) If I snap off the thermistor/PDM portion of the board, I am no longer able to communicate with the SPI Flash. This puzzles me, since the SPI Flash is on a different section of the board and should be unaffected by the removal of the thermistor/PDM section. Here's what we get trying to mount LFS:

lfs error:494: Corrupted dir pair at 0 1 lfs error:2216: Invalid superblock at 0 1 Mounting filesystem...Fail lfs error:494: Corrupted dir pair at 0 1 lfs error:2216: Invalid superblock at 0 1 No filesystem found, formatting... Fail

I have a second CY8CPROTO-062-4343W with the thermistor still attached, and everything works just fine. Another coworker is able to replicate this as well. His board was working until he snapped off the thermistor portion.

2.) WiFi/BLE coexistance seems to be a little flaky. Sometimes the WiFi will fail to connect to an access point if BLE is already connected. Is this something you've seen? I know that ESP32 has a similar issue since the WiFi and BLE share a radio signal path.

-Nick

0 Likes
18 Replies
VinayakS_26
Moderator
Moderator
Moderator
100 replies posted 50 replies posted 25 replies posted

Hi Nick,

What is activity happening in BLE while Wifi fails? Is it sending any data(if so what kind of data)? Does the wifi remain disconnected or does it connect when the ble activity ceases?

Regards,

VinayakS_26

0 Likes

BLE is connected and typically the GATT characteristics are being interacted with by the central device (a mobile device).

The call to wifi->connect returns an error. We do not yet have logic to retry multiple times.

-Nick

0 Likes

The more pressing issue is the thermistor/spi flash interdependence. Do you have any idea about that?

-Nick

0 Likes

Hello Nick,

I tested a project based on mbed-os-example-filesystem and it works both with and without the snap-off thermistor portion. Can you please attach your project so that I can try to replicate your issue?

Regards,

Dheeraj

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

I've attached the .hex as well as the source.

We are using commit #c7c48193d40ae745e9ddcd668aa10390611a46a3 of the mbed-os currently with this project. It's not contained in the source, so you must build that commit of mbed-os yourself, then tell our project where it is when you go to build it.

-Nick

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Nick,

I tried compiling your project after adding mbed-os library and I get the errors as attached in the log. Please zip the working directory and attach it.

So, I tried running the hex. I was able to recreate your issue. I'm trying to resolve the compilation issues so that I can then import into some IDE and do some debugging. It would be easier if you could provide the entire compiled directory.

Regards,

Dheeraj

lock attach
Attachments are accessible only for community members.

Hi,

Took a little bit of work, but here it is. The way we compile mbed projects in Atmosphere IDE is we precompile the whole mbed-os per target (to reduce individual project build time). Here's a more standalone version of the source. You can see the build.sh script for how to build it, but it's pretty standard. Just added the correct mbed library. Verified it builds on my ubuntu machine.

Let me know if you have any problems building this one.

-Nick

0 Likes

Hello Nick,

I looked into the schematic of both the thermistor and the SD Card regions and I don't see any line which is conflicting. Both have their own supply voltage, their own lines, so I don't understand how removing the thermistor portion is affecting it in terms of hardware. You can find the schematic here: https://www.cypress.com/file/457811/download

Now coming to the source code, I wasn't able to debug because the compilation comes with a huge set of other problems. Hence, I was looking at the source files in just the editor. In the file pin_mapping.h in the path: "atmosphere_psoc6_flash\source\app_src\" you have defined the pin mapping as follows:

#define P_THERMISTOR_VDD P10_0

#define P_THERMISTOR_OUTPUT1 P10_1

#define P_THERMISTOR_OUTPUT2 P10_2

#define P_THERMISTOR_GND P10_3

Here you have the ground and VDD reversed. Please change to the following:

#define P_THERMISTOR_VDD P10_3

#define P_THERMISTOR_OUTPUT1 P10_1

#define P_THERMISTOR_OUTPUT2 P10_2

#define P_THERMISTOR_GND P10_0

I can only see the card detect pin assigned, can you please let me know where the SDIO pin mappings are being done?

Regards,

Dheeraj

Hi,

The SPI flash pins are handled by mbed if you look in filesystem.cpp. we

don't use the SDIO.

I agree looking at the schematic there should be no connection.

I'll look into the thermistor pins. I vaguely remember when I was initially

implementing the board it seemed like they were swapped in the schematic

after I did some testing with a voltmeter.

Nick

On Tue, Jan 28, 2020, 4:55 AM DheerajK_81 <community-manager@cypress.com>

0 Likes

Hello Nick,

I don't see where the QSPI initialization is taking place. Something like this:

QSPI qspi_device(QSPI_FLASH1_IO0, QSPI_FLASH1_IO1, QSPI_FLASH1_IO2, QSPI_FLASH1_IO3, QSPI_FLASH1_SCK, QSPI_FLASH1_CSN); // io0, io1, io2, io3, sclk, ssel

Where is the "BlockDevice.h" file? I see it included as a header file but it isn't part of the files you provided me. I suspect this file has the information I'm looking for.

Regards,

Dheeraj

That's all part of mbed. BlockDevice.h is one of their files:

https://github.com/ARMmbed/mbed-os/tree/master/features/storage/blockdevice.

It always takes me a minute to get my bearings in mbed-os, but you can

trace the initialization to mbed-os/features/storage/SystemStorage.cpp.

That's where BlockDevice::get_default_instance is (weakly) defined.

Looking at mbed-os/targets/targets.json, you'll see that MCU_PSOC6_M4,

which the CY8CPROTO_062_4343W inherits, has "QSPIF" in its

"components_add" list. Therefore, in SystemStorage.cpp, it should

initialize the QSPIF.

That's my interpretation, anyway, I'm not an mbed expert. From the user

application, all we should need to do is call get_default_instance to

grab the block device from mbed-os and then use it.

Hope that helps,

-Nick

0 Likes

I'm not sure what is corrupting the filesystem. We have seen issues when moving from one filesystem to another as described here.

I would suggest formatting the storage. Also, whenever a mount fails, you can force a reformat of the storage. Until the root cause for corruption is determined, this workaround should get you going.

Regards,

Dheeraj

Hi,

Thanks for the reply. That is what our code is doing. You can see it attempting to mount, failing, then trying to format in the log I included in my initial post.

The logic will try to mount the storage. If that fails, it will attempt to force a format. In this case, both of those fail.

-Nick

0 Likes

Hello Nick,

Are you debugging your application in any way apart from printing the debug information? Do you have a stack trace available when the failure occurs. Due to different components being used in the code, I am not able to compile successfully and hence not able to import into any IDE for debugging.

Please attach your stack trace or the fully compiled application zip file.

Regards,

Dheeraj

0 Likes

I sent the full source on Jan 13 with instructions and even a script compiling it on a fresh Ubuntu machine. What issue are you having with that?

-Nick

0 Likes

I was getting errors with the mbed-os library files not being referenced. I added your source files right under my drive folder and it compiled successfully. Looks like there was a max long path issue I was facing. Anyways, I'll import it into Eclipse and debug it now. Let's see what the root cause for this failure is.

Regards,

Dheeraj

0 Likes

Hello Nick,

When compiling your project, please make use of the Release profile:

mbed compile -t GCC_ARM -m CY8CPROTO_062_4343W -f --profile release

Can you please test the project at your end and let me know if it works.

Regards,

Dheeraj

lock attach
Attachments are accessible only for community members.

Hi,

I added that flag, but it didn't seem to make a difference to the SPI Flash functionality. I've attached my hex.

Thanks,

Nick

0 Likes