Merge pull request #97 from bridadan/nc_pins

Defaulting pins to NC to prevent undefined pin issues
pull/7774/head
Deepika 2018-05-08 15:19:29 -05:00 committed by GitHub
commit 21e465bd72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 20 deletions

View File

@ -24,7 +24,7 @@ SDCard support and other resources, as outlined below:
- POSIX File API test cases for testing the FAT32 filesystem on SDCard.
- basic.cpp, a basic set of functional test cases.
- fopen.cpp, more functional tests reading/writing greater volumes of data to SDCard, for example.
- `mbed_lib.json` mbed-os application configuration file with SPI pin configurations for the CI shield and overrides for specific targets.
- `mbed_lib.json` mbed-os application configuration file with SPI pin configurations and overrides for specific targets.
This file allows the SPI pins to be specified for the target without having to edit the implementation files.
- This README which includes [Summary of POSIX File API Documentation](#summary-posix-api-documentation)
including detailed instruction on how to use the FAT filesystem and SDBlockDevice driver.
@ -193,10 +193,10 @@ The following is an example of the `mbed_lib.json` file available in the reposit
{
"config": {
"SPI_CS": "D10",
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "NC",
"SPI_MOSI": "NC",
"SPI_MISO": "NC",
"SPI_CLK": "NC",
"DEVICE_SPI": 1,
"FSFAT_SDCARD_INSTALLED": 1
},
@ -228,13 +228,12 @@ Note the following things about the `mbed_lib.json` file:
- "SPI\_MOSI". This is the Master Out Slave In data line.
- "SPI\_MISO". This is the Master In Slave Out data line.
- "SPI\_CLK". This is the serial Clock line.
- The default configuration defined in the "config" section is for the standard Arduino header pin mappings for the SPI bus.
The "config" section defines a dictionary mapping functional names to target board Arduino header pins:
- "SPI\_CS": "D10". This causes the MBED\_CONF\_APP\_SPI\_CS symbol to be defined in mbed\_config.h as D10, which is used in the filesystem test implementation.
D10 is defined in the target specific PinNames.h file.
- "SPI\_MOSI": "D11". This causes the MBED\_CONF\_APP\_SPI\_MOSI symbol to be defined in mbed\_config.h.
- "SPI\_MISO": "D12". This causes the MBED\_CONF\_APP\_SPI\_MISO symbol to be defined in mbed\_config.h.
- "SPI\_CLK": "D13". This causes the MBED\_CONF\_APP\_SPI\_CLK symbol to be defined in mbed\_config.h.
- The default configuration defined in the "config" section **is not valid for any platform** (will error at runtime).
The "config" section defines a dictionary mapping functional names to target board pins:
- "SPI\_CS" causes the MBED\_CONF\_APP\_SPI\_CS symbol to be defined in mbed\_config.h, which is used in the filesystem test implementation.
- "SPI\_MOSI" causes the MBED\_CONF\_APP\_SPI\_MOSI symbol to be defined in mbed\_config.h.
- "SPI\_MISO" causes the MBED\_CONF\_APP\_SPI\_MISO symbol to be defined in mbed\_config.h.
- "SPI\_CLK" causes the MBED\_CONF\_APP\_SPI\_CLK symbol to be defined in mbed\_config.h.
- The `"target_overrides"` section is used to override the "SPI\_xxx" symbols for specific target boards, which may have an SDCard slot, for example.
This is the case for the K64F, where the "SPI\_xxx" are mapped to the pin names for the on-board SDCard.
@ -247,13 +246,19 @@ Note the following things about the `mbed_lib.json` file:
}
```
- Thus, in the absence of any target specific definitions in the `"target_overrides"` section, all boards will default to
using the Arduino header configuration. For those platforms with a `"target_overrides"` section then this configuration
using the invalid configuration (will error at runtime). For those platforms with a `"target_overrides"` section then this configuration
will be used in preference.
- Hence in the case that you want to test a platform with an SDCard inserted into a
fitted CI test shield (rather than the on-board SDCard slot)
and there is a `"target_overrides"` section present in the `mbed_lib.json` file, you must then delete the `"target_overrides"`
and there is a `"target_overrides"` section present in the `mbed_lib.json` file, you must provide the correct Arduino pins in the `"target_overrides"`
section before building. This will result in the default configuration being used (suitable for the CI
Test Shield).
Test Shield). The correct pins for the CI test shield are as follows:
"<your platform name>": {
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "D10"
}
- Note when inserting the v1.0.0 CI Test Shield into the Arduino header of the target platform, the shield pins D0 and
D1 should be bent to be parallel to the shield PCB so they are not inserted into the Arduino header. This is because
some boards use the same UART on DAPLINK and D0/D1, which means the serial debug channel breaks and hence the mbed greentea
@ -402,7 +407,7 @@ The build trace is quite extensive but on a successful build you should see the
* K64F::GCC_ARM::SD-DRIVER-TESTS-FILESYSTEM-FOPEN
* K64F::GCC_ARM::SD-DRIVER-TESTS-FILESYSTEM-PARALLEL
* K64F::GCC_ARM::SD-DRIVER-TESTS-FILESYSTEM-SEEK
Build skips:
* K64F::GCC_ARM::MBED-OS-FEATURES-FEATURE_LWIP-TESTS-MBEDMICRO-NET-TCP_PACKET_PRESSURE
<trace removed>

View File

@ -1,10 +1,10 @@
{
"name": "sd",
"config": {
"SPI_CS": "D10",
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "NC",
"SPI_MOSI": "NC",
"SPI_MISO": "NC",
"SPI_CLK": "NC",
"DEVICE_SPI": 1,
"FSFAT_SDCARD_INSTALLED": 1,
"CMD_TIMEOUT": 5000,
@ -18,6 +18,12 @@
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS"
},
"DISCO_L475VG_IOT01A": {
"SPI_MOSI": "SPI_MOSI",
"SPI_MISO": "SPI_MISO",
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS"
},
"DISCO_L476VG": {
"SPI_MOSI": "PE_15",
"SPI_MISO": "PE_14",
@ -95,6 +101,12 @@
"SPI_MISO": "PC_11",
"SPI_CLK": "PC_10",
"SPI_CS": "PA_15"
},
"NUCLEO_F746ZG": {
"SPI_MOSI": "PC_12",
"SPI_MISO": "PC_11",
"SPI_CLK": "PC_10",
"SPI_CS": "PA_15"
},
"NUCLEO_F767ZI": {
"SPI_MOSI": "PC_12",
@ -108,12 +120,24 @@
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS"
},
"NUCLEO_L476RG": {
"SPI_MOSI": "SPI_MOSI",
"SPI_MISO": "SPI_MISO",
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS"
},
"NUMAKER_PFM_M453": {
"SPI_MOSI": "PD_13",
"SPI_MISO": "PD_14",
"SPI_CLK": "PD_15",
"SPI_CS": "PD_12"
},
"NUMAKER_PFM_M487": {
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "D10"
},
"NUMAKER_PFM_NUC472": {
"SPI_MOSI": "PF_0",
"SPI_MISO": "PD_15",
@ -126,6 +150,12 @@
"SPI_CLK": "p15",
"SPI_CS": "p14"
},
"UBLOX_C030_U201": {
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "D10"
},
"UBLOX_EVK_ODIN_W2": {
"SPI_CS": "D9",
"SPI_MOSI": "D11",
@ -173,6 +203,12 @@
"SPI_MISO": "p6",
"SPI_CLK": "p7",
"SPI_CS": "p8"
},
"REALTEK_RTL8195AM": {
"SPI_MOSI": "D11",
"SPI_MISO": "D12",
"SPI_CLK": "D13",
"SPI_CS": "D9"
}
}
}