summaryrefslogtreecommitdiff
path: root/nuttx/configs/vsn
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/configs/vsn')
-rwxr-xr-xnuttx/configs/vsn/nsh/defconfig14
-rw-r--r--nuttx/configs/vsn/src/sif.c33
-rw-r--r--nuttx/configs/vsn/src/sysclock.c4
3 files changed, 36 insertions, 15 deletions
diff --git a/nuttx/configs/vsn/nsh/defconfig b/nuttx/configs/vsn/nsh/defconfig
index c33e36dbf..dd5b1ca37 100755
--- a/nuttx/configs/vsn/nsh/defconfig
+++ b/nuttx/configs/vsn/nsh/defconfig
@@ -522,8 +522,10 @@ CONFIG_PREALLOC_TIMERS=4
#
# CONFIG_FS_FAT - Enable FAT filesystem support
# CONFIG_FAT_SECTORSIZE - Max supported sector size
+# CONFIG_FS_NXFFS - Enable NX Flash File System
# CONFIG_FS_ROMFS - Enable ROMFS filesystem support
CONFIG_FS_FAT=y
+CONFIG_FS_NXFFS=y
CONFIG_FS_ROMFS=y
#
@@ -891,15 +893,3 @@ CONFIG_APPS_DIR="../apps"
# Provide /dev/ramX and then: mount -t binfs /dev/ram0 /bin
CONFIG_APPS_BINDIR=y
-
-# Application configuration
-
-CONFIG_APPS_DIR="../apps"
-
-# Application configuration
-
-CONFIG_APPS_DIR="../apps"
-
-# Application configuration
-
-CONFIG_APPS_DIR="../apps"
diff --git a/nuttx/configs/vsn/src/sif.c b/nuttx/configs/vsn/src/sif.c
index 4be214444..2cd807138 100644
--- a/nuttx/configs/vsn/src/sif.c
+++ b/nuttx/configs/vsn/src/sif.c
@@ -74,6 +74,7 @@
#include <nuttx/clock.h>
#include <nuttx/time.h>
#include <nuttx/rtc.h>
+#include <nuttx/progmem.h>
#include <nuttx/i2c.h>
#include <nuttx/sensors/st_lis331dl.h>
@@ -512,6 +513,36 @@ int sif_main(int argc, char *argv[])
t_set.tv_sec = atoi(argv[2]);
clock_settime(CLOCK_REALTIME, &t_set);
}
+ else if (!strcmp(argv[1], "free") ) {
+ uint16_t page = 0, stpage = 0xFFFF;
+ int status;
+ do {
+ status = up_progmem_ispageerased(page++);
+
+ /* Is this beginning of new free space section */
+ if (status == 0) {
+ if (stpage == 0xFFFF) stpage = page-1;
+ }
+ else if (status != 0) {
+ if (stpage != 0xFFFF) {
+ printf("Free Range:\t%d\t-\t%d\n", stpage, page-2);
+ stpage = 0xFFFF;
+ }
+ }
+ }
+ while (status >= 0);
+ }
+ else if (!strcmp(argv[1], "erase") && argc == 3 ) {
+ int page = atoi(argv[2]);
+ printf("Erase result: %d\n", up_progmem_erasepage(page) );
+ }
+ else if (!strcmp(argv[1], "flash") && argc == 3 ) {
+ uint16_t page = atoi(argv[2]);
+ uint32_t addr = page * up_progmem_pagesize(page);
+
+ printf("Write result: %d (writing to address %xh)\n",
+ up_progmem_write( addr, "Test", 4 ), addr);
+ }
else if (!strcmp(argv[1], "i2c") && argc == 3) {
int val = atoi(argv[2]);
@@ -520,7 +551,7 @@ int sif_main(int argc, char *argv[])
struct st_lis331dl_dev_s * lis = st_lis331dl_init(vsn_sif.i2c1, val);
if (lis) {
- struct st_lis331dl_vector_s * a;
+ const struct st_lis331dl_vector_s * a;
int i;
uint32_t time_stamp = clock_systimer();
diff --git a/nuttx/configs/vsn/src/sysclock.c b/nuttx/configs/vsn/src/sysclock.c
index f65ae0670..8b1a0be34 100644
--- a/nuttx/configs/vsn/src/sysclock.c
+++ b/nuttx/configs/vsn/src/sysclock.c
@@ -78,8 +78,8 @@ void sysclock_select_hsi(void)
// Set FLASH prefetch buffer and 1 wait state
regval = getreg32(STM32_FLASH_ACR);
- regval &= ~ACR_LATENCY_MASK;
- regval |= (ACR_LATENCY_1|ACR_PRTFBE);
+ regval &= ~FLASH_ACR_LATENCY_MASK;
+ regval |= (FLASH_ACR_LATENCY_1|FLASH_ACR_PRTFBE);
putreg32(regval, STM32_FLASH_ACR);
// Set the HCLK source/divider