Skip to content

Commit

Permalink
Fix #375, Separate network logic in pc-rtems to support generic targets
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Dec 19, 2023
1 parent f27c73e commit a988491
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fsw/pc-rtems/make/build_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# This indicates where to install target binaries created during the build
# Note - this should be phased out in favor of the staging dir from OSAL BSP
set(INSTALL_SUBDIR "eeprom")
set(INSTALL_SUBDIR "nonvol")

# Some upper-level code may be gated on _RTEMS_OS_ being defined
# This is for compatibility with older build scripts which defined this symbol,
Expand Down
13 changes: 10 additions & 3 deletions fsw/pc-rtems/src/cfe_psp_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
#include <errno.h>
#include <rtems.h>
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_dhcp_failsafe.h>
#include <bsp.h>
/* TODO Only needed for network setup, move? */
//#include <rtems/rtems_dhcp_failsafe.h>
//#include <bsp.h>

/*
** cFE includes
Expand All @@ -61,6 +62,8 @@

rtems_id RtemsTimerId;

/* TODO in pc but not in generic... might be the only unique stuff? */
#if 0
static unsigned char ethernet_address[6] = {0x00, 0x04, 0x9F, 0x00, 0x27, 0x61};
static char net_name_str[] = "fxp1";
static char ip_addr_str[] = "10.0.2.17";
Expand All @@ -76,9 +79,11 @@ static struct rtems_bsdnet_ifconfig netdriver_config = {
/* more options can follow */
};


struct rtems_bsdnet_config rtems_bsdnet_config = {
.ifconfig = &netdriver_config, .bootp = rtems_bsdnet_do_dhcp_failsafe, /* fill if DHCP is used*/
};
#endif

/*
** 1 HZ Timer "ISR"
Expand Down Expand Up @@ -198,7 +203,9 @@ void CFE_PSP_Main(void)
/*
** Set up the virtual FS mapping for the "/cf" directory
*/
Status = OS_FileSysAddFixedMap(&fs_id, "/mnt/eeprom", "/cf");
/* TODO maybe make this into a config... or just switch to nonvol */
// Status = OS_FileSysAddFixedMap(&fs_id, "/mnt/eeprom", "/cf");
Status = OS_FileSysAddFixedMap(&fs_id, "/nonvol", "/cf");
if (Status != OS_SUCCESS)
{
/* Print for informational purposes --
Expand Down

0 comments on commit a988491

Please sign in to comment.