Skip to content

Commit

Permalink
Merge pull request PX4#5 from cvg/fmuv2_bringup_ramtron
Browse files Browse the repository at this point in the history
Enable support for RAMTRON, enable support for EEPROM on FMU 1.x
  • Loading branch information
LorenzMeier committed Apr 20, 2013
2 parents 5f26018 + 94084ec commit e895198
Show file tree
Hide file tree
Showing 12 changed files with 1,142 additions and 15 deletions.
3 changes: 2 additions & 1 deletion makefiles/config_px4fmu_default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common
# Board support modules
#
MODULES += drivers/px4fmu
MODULES += systemcmds/eeprom

#
# Transitional support - add commands from the NuttX export archive.
Expand All @@ -36,7 +37,6 @@ BUILTIN_COMMANDS := \
$(call _B, commander, SCHED_PRIORITY_MAX-30, 2048, commander_main ) \
$(call _B, control_demo, , 2048, control_demo_main ) \
$(call _B, delay_test, , 2048, delay_test_main ) \
$(call _B, eeprom, , 4096, eeprom_main ) \
$(call _B, fixedwing_att_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_att_control_main ) \
$(call _B, fixedwing_pos_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_pos_control_main ) \
$(call _B, gps, , 2048, gps_main ) \
Expand Down Expand Up @@ -66,4 +66,5 @@ BUILTIN_COMMANDS := \
$(call _B, tests, , 12000, tests_main ) \
$(call _B, tone_alarm, , 2048, tone_alarm_main ) \
$(call _B, top, SCHED_PRIORITY_DEFAULT-10, 3000, top_main ) \
$(call _B, param, SCHED_PRIORITY_DEFAULT-10, 2048, param_main ) \
$(call _B, uorb, , 4096, uorb_main )
2 changes: 2 additions & 0 deletions makefiles/config_px4fmuv2_default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ MODULES += drivers/boards/px4fmuv2
MODULES += drivers/lsm303d
MODULES += drivers/px4fmu
MODULES += drivers/rgbled
MODULES += systemcmds/ramtron

#
# Transitional support - add commands from the NuttX export archive.
Expand Down Expand Up @@ -61,4 +62,5 @@ BUILTIN_COMMANDS := \
$(call _B, tests, , 12000, tests_main ) \
$(call _B, tone_alarm, , 2048, tone_alarm_main ) \
$(call _B, top, SCHED_PRIORITY_DEFAULT-10, 3000, top_main ) \
$(call _B, param, SCHED_PRIORITY_DEFAULT-10, 2048, param_main ) \
$(call _B, uorb, , 4096, uorb_main )
1 change: 0 additions & 1 deletion nuttx/configs/px4fmu/nsh/appconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ CONFIGURED_APPS += systemcmds/perf
CONFIGURED_APPS += systemcmds/top
CONFIGURED_APPS += systemcmds/boardinfo
CONFIGURED_APPS += systemcmds/mixer
CONFIGURED_APPS += systemcmds/eeprom
CONFIGURED_APPS += systemcmds/param
CONFIGURED_APPS += systemcmds/pwm
CONFIGURED_APPS += systemcmds/bl_update
Expand Down
6 changes: 1 addition & 5 deletions nuttx/configs/px4fmuv2/nsh/appconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ CONFIGURED_APPS += systemcmds/perf
CONFIGURED_APPS += systemcmds/top
CONFIGURED_APPS += systemcmds/boardinfo
CONFIGURED_APPS += systemcmds/mixer
# No I2C EEPROM - need new param interface
#CONFIGURED_APPS += systemcmds/eeprom
#CONFIGURED_APPS += systemcmds/param
CONFIGURED_APPS += systemcmds/param
CONFIGURED_APPS += systemcmds/pwm
CONFIGURED_APPS += systemcmds/bl_update
CONFIGURED_APPS += systemcmds/preflight_check
Expand Down Expand Up @@ -95,10 +93,8 @@ CONFIGURED_APPS += sdlog
CONFIGURED_APPS += sensors

ifneq ($(CONFIG_APM),y)
#CONFIGURED_APPS += ardrone_interface
CONFIGURED_APPS += multirotor_att_control
CONFIGURED_APPS += multirotor_pos_control
#CONFIGURED_APPS += fixedwing_control
CONFIGURED_APPS += fixedwing_att_control
CONFIGURED_APPS += fixedwing_pos_control
CONFIGURED_APPS += position_estimator
Expand Down
4 changes: 4 additions & 0 deletions nuttx/configs/px4fmuv2/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ CONFIG_I2C_RESET=y
# XXX fixed per-transaction timeout
CONFIG_STM32_I2CTIMEOMS=10

#
# MTD support
#
CONFIG_MTD=y

# XXX re-enable after integration testing

Expand Down
8 changes: 8 additions & 0 deletions nuttx/drivers/mtd/ramtron.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ struct ramtron_dev_s

static struct ramtron_parts_s ramtron_parts[] =
{
{
"FM25V01", /* name */
0x21, /* id1 */
0x00, /* id2 */
16L*1024L, /* size */
2, /* addr_len */
40000000 /* speed */
},
{
"FM25V02", /* name */
0x22, /* id1 */
Expand Down
17 changes: 9 additions & 8 deletions src/drivers/boards/px4fmuv2/px4fmu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ __EXPORT int nsh_archinitialize(void)
spi1 = up_spiinitialize(1);

if (!spi1) {
message("[boot] FAILED to initialize SPI port 1\r\n");
message("[boot] FAILED to initialize SPI port 1\n");
up_ledon(LED_AMBER);
return -ENODEV;
}

// Default SPI1 to 1MHz and de-assert the known chip selects.
/* Default SPI1 to 1MHz and de-assert the known chip selects. */
SPI_SETFREQUENCY(spi1, 10000000);
SPI_SETBITS(spi1, 8);
SPI_SETMODE(spi1, SPIDEV_MODE3);
Expand All @@ -206,11 +206,10 @@ __EXPORT int nsh_archinitialize(void)
SPI_SELECT(spi1, PX4_SPIDEV_BARO, false);
up_udelay(20);

message("[boot] Successfully initialized SPI port 1\r\n");
message("[boot] Successfully initialized SPI port 1\n");

/* Get the SPI port for the FRAM */

message("[boot] Initializing SPI port 2\n");
spi2 = up_spiinitialize(2);

if (!spi2) {
Expand All @@ -219,11 +218,13 @@ __EXPORT int nsh_archinitialize(void)
return -ENODEV;
}

message("[boot] Successfully initialized SPI port 2\n");

/* XXX need a driver to bind the FRAM to */
/* Default SPI2 to 37.5 MHz (F4 max) and de-assert the known chip selects. */
SPI_SETFREQUENCY(spi2, 375000000);
SPI_SETBITS(spi2, 8);
SPI_SETMODE(spi2, SPIDEV_MODE3);
SPI_SELECT(spi2, SPIDEV_FLASH, false);

//message("[boot] Successfully bound SPI port 2 to the FRAM driver\n");
message("[boot] Successfully initialized SPI port 2\n");

return OK;
}
Loading

0 comments on commit e895198

Please sign in to comment.