...
 
Commits (4)
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config HN70AP_RXT
bool "hn70ap RX test"
default y
---help---
Test Radio Reception.
if HN70AP_RXT
config HN70AP_RXT_PROGNAME
string "Program name"
default "rxt"
depends on BUILD_KERNEL
---help---
This is the name of the program that will be use when the NSH ELF
program is installed.
config HN70AP_RXT_PRIORITY
int "hn70ap rxt task priority"
default 100
config HN70AP_RXT_STACKSIZE
int "hn70ap rxt stack size"
default 2048
endif
############################################################################
# hn70ap/apps/rxt/Make.defs
# Adds selected applications to apps/ build
#
# Copyright (C) 20158 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
ifeq ($(CONFIG_HN70AP_RXT),y)
CONFIGURED_APPS += hn70ap/rxt
endif
############################################################################
# hn70ap/apps/rxt/Makefile
#
# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
# Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
# RX test built-in application info
CONFIG_HN70AP_RXT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_HN70AP_RXT_STACKSIZE ?= 2048
APPNAME = rxt
PRIORITY = $(CONFIG_HN70AP_RXT_PRIORITY)
STACKSIZE = $(CONFIG_HN70AP_RXT_STACKSIZE)
ASRCS =
CSRCS =
MAINSRC = rxt_main.c
CONFIG_HN70AP_RXT_PROGNAME ?= $(APPNAME)$(EXEEXT)
PROGNAME = $(CONFIG_HN70AP_RXT_PROGNAME)
include $(APPDIR)/Application.mk
/****************************************************************************
* hn70ap/apps/rxt/rxt_main.c
*
* Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* status_main
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int rxt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
int ret = OK;
int fd;
int buflen = 1024;
int i;
uint8_t *buf;
if(argc > 1)
{
devname = argv[1];
}
printf("RX test using %s\n", devname);
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto done;
}
buf = malloc(buflen);
if(!buf)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retclose;
}
do
{
ret = read(fd, buf, buflen);
printf("read done, ret = %d, errno=%d\n", ret, errno);
if(ret > 0)
{
for(i=0; i<ret; i++)
{
printf("%02X ", buf[i]);
}
printf("\n");
}
}
while(ret > 0);
printf("Read sequence done.\n");
free(buf);
retclose:
close(fd);
done:
return ret;
}
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config HN70AP_TXT
bool "hn70ap TX test"
default y
---help---
Test Radio Transmission.
if HN70AP_TXT
config HN70AP_TXT_PROGNAME
string "Program name"
default "txt"
depends on BUILD_KERNEL
---help---
This is the name of the program that will be use when the NSH ELF
program is installed.
config HN70AP_TXT_PRIORITY
int "hn70ap txt task priority"
default 100
config HN70AP_TXT_STACKSIZE
int "hn70ap txt stack size"
default 2048
endif
############################################################################
# hn70ap/apps/txt/Make.defs
# Adds selected applications to apps/ build
#
# Copyright (C) 20158 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
ifeq ($(CONFIG_HN70AP_TXT),y)
CONFIGURED_APPS += hn70ap/txt
endif
############################################################################
# hn70ap/apps/txt/Makefile
#
# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
# Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
# Author: Sebastien Lorquet <sebastien@lorquet.fr>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-include $(TOPDIR)/Make.defs
# RX test built-in application info
CONFIG_HN70AP_TXT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_HN70AP_TXT_STACKSIZE ?= 2048
APPNAME = txt
PRIORITY = $(CONFIG_HN70AP_TXT_PRIORITY)
STACKSIZE = $(CONFIG_HN70AP_TXT_STACKSIZE)
ASRCS =
CSRCS =
MAINSRC = txt_main.c
CONFIG_HN70AP_TXT_PROGNAME ?= $(APPNAME)$(EXEEXT)
PROGNAME = $(CONFIG_HN70AP_TXT_PROGNAME)
include $(APPDIR)/Application.mk
/****************************************************************************
* hn70ap/apps/txt/txt_main.c
*
* Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Copyright (C) 2018 Sebastien Lorquet. All rights reserved.
* Author: Sebastien Lorquet <sebastien@lorquet.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
/****************************************************************************
* Public Functions
****************************************************************************/
int txt_usage(void)
{
printf(
"txt [device] hexdata_nospaces\n"
);
return ERROR;
}
char* h2b(char *ptr, uint8_t *out)
{
if(*ptr >= 0 && *ptr <= '9')
{
*out = *ptr - '0';
}
else if(*ptr >= 'A' && *ptr <= 'F')
{
*out = *ptr - 'A' + 10;
}
else if(*ptr >= 'a' && *ptr <= 'f')
{
*out = *ptr - 'a' + 10;
}
else
{
return NULL;
}
*out <<= 4;
ptr++;
if(! (*ptr))
{
return ptr;
}
if(*ptr >= 0 && *ptr <= '9')
{
*out |= *ptr - '0';
}
else if(*ptr >= 'A' && *ptr <= 'F')
{
*out |= *ptr - 'A' + 10;
}
else if(*ptr >= 'a' && *ptr <= 'f')
{
*out |= *ptr - 'a' + 10;
}
else
{
return NULL;
}
ptr++;
return ptr;
}
/****************************************************************************
* status_main
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int txt_main(int argc, char *argv[])
#endif
{
char *devname = "/dev/raux";
char *data;
int ret = OK;
int fd;
int buflen = 1024;
int len;
uint8_t *buf;
if(argc == 3)
{
devname = argv[1];
data = argv[2];
}
else if(argc == 2)
{
data = argv[1];
}
else
{
return txt_usage();
}
buf = malloc(buflen);
if(!buf)
{
fprintf(stderr, "malloc failed!\n");
ret = ERROR;
goto done;
}
len = 0;
while(*data && len < buflen)
{
data = h2b(data, buf+len);
if(data == NULL)
{
fprintf(stderr, "HEX parse error ->$s\n", data);
goto retfree;
}
printf("%02X",buf[len]);
len += 1;
}
printf("\nTX test using %s (%d bytes)\n", devname, len);
fd = open(devname, O_RDWR);
if(fd<0)
{
fprintf(stderr, "open failed!\n");
ret = ERROR;
goto retfree;
}
ret = write(fd, buf, len);
printf("write done, ret = %d, errno=%d\n", ret, errno);
close(fd);
retfree:
free(buf);
done:
return ret;
}
......@@ -493,7 +493,7 @@ CONFIG_STM32_PWR=y
CONFIG_STM32_SPI2=y
# CONFIG_STM32_SPI3 is not set
# CONFIG_STM32_I2S3 is not set
# CONFIG_STM32_SPI4 is not set
CONFIG_STM32_SPI4=y
# CONFIG_STM32_SPI5 is not set
# CONFIG_STM32_SPI6 is not set
CONFIG_STM32_SYSCFG=y
......@@ -739,8 +739,10 @@ CONFIG_HN70AP_SPIFLASH=y
CONFIG_HN70AP_SCREEN=y
CONFIG_HN70AP_ETHERNET=y
CONFIG_HN70AP_ETHERNET_EEMAC=y
CONFIG_HN70AP_RADIO=y
# CONFIG_HN70AP_MAINRADIO is not set
# CONFIG_HN70AP_AUXRADIO is not set
CONFIG_HN70AP_AUXRADIO=y
# CONFIG_HN70AP_AUXRADIO_HIGHPOWER is not set
# CONFIG_BOARD_CRASHDUMP is not set
CONFIG_LIB_BOARDCTL=y
CONFIG_BOARDCTL_RESET=y
......@@ -1177,14 +1179,7 @@ CONFIG_DRIVERS_WIRELESS=y
CONFIG_DRIVERS_GENERICRADIO=y
CONFIG_GENERICRADIO_UPPER=y
CONFIG_GENERICRADIO_SI4463=y
CONFIG_GENERICRADIO_SI4463_DEFAULT_FREQ=0
CONFIG_GENERICRADIO_SI4463_DEFAULT_CHSPC=100000000
CONFIG_GENERICRADIO_SI4463_DEFAULT_PREAMBLELEN=32
CONFIG_GENERICRADIO_SI4463_DEFAULT_SYNCWORD_NONE=y
# CONFIG_GENERICRADIO_SI4463_DEFAULT_SYNCWORD_A55A is not set
# CONFIG_GENERICRADIO_SI4463_DEFAULT_SYNCWORD_4242 is not set
# CONFIG_GENERICRADIO_SI4463_DEFAULT_SYNCWORD_A55AA55A is not set
# CONFIG_GENERICRADIO_SI4463_DEFAULT_SYNCWORD_42424242 is not set
CONFIG_GENERICRADIO_SI4463_USE_WDS_CONFIG=y
# CONFIG_WL_NRF24L01 is not set
# CONFIG_DRIVERS_CONTACTLESS is not set
......@@ -1250,6 +1245,7 @@ CONFIG_NET_IPv4=y
CONFIG_NSOCKET_DESCRIPTORS=8
CONFIG_NET_NACTIVESOCKETS=16
CONFIG_NET_SOCKOPTS=y
# CONFIG_NET_TCPPROTO_OPTIONS is not set
# CONFIG_NET_SOLINGER is not set
#
......@@ -1267,6 +1263,7 @@ CONFIG_NET_SOCKOPTS=y
#
CONFIG_NET_TCP=y
# CONFIG_NET_TCP_NO_STACK is not set
# CONFIG_NET_TCP_KEEPALIVE is not set
# CONFIG_NET_TCPURGDATA is not set
# CONFIG_NET_TCP_REASSEMBLY is not set
CONFIG_NET_TCP_CONNS=8
......@@ -1605,6 +1602,7 @@ CONFIG_EXAMPLES_NSH=y
# CONFIG_EXAMPLES_SERIALBLASTER is not set
# CONFIG_EXAMPLES_SERIALRX is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_SI5351 is not set
# CONFIG_EXAMPLES_SLCD is not set
# CONFIG_EXAMPLES_SMART is not set
# CONFIG_EXAMPLES_SMART_TEST is not set
......@@ -1662,9 +1660,15 @@ CONFIG_HN70AP_CONFIG=y
CONFIG_HN70AP_CONFIG_PRIORITY=100
CONFIG_HN70AP_CONFIG_STACKSIZE=2048
CONFIG_LIBHN70AP=y
CONFIG_HN70AP_RXT=y
CONFIG_HN70AP_RXT_PRIORITY=100
CONFIG_HN70AP_RXT_STACKSIZE=2048
CONFIG_HN70AP_SYSDAEMON=y
CONFIG_HN70AP_SYSDAEMON_PRIORITY=100
CONFIG_HN70AP_SYSDAEMON_STACKSIZE=2048
CONFIG_HN70AP_TXT=y
CONFIG_HN70AP_TXT_PRIORITY=100
CONFIG_HN70AP_TXT_STACKSIZE=2048
CONFIG_HN70AP_UPDATE=y
CONFIG_HN70AP_UPDATE_PRIORITY=100
CONFIG_HN70AP_UPDATE_STACKSIZE=2048
......
......@@ -139,7 +139,7 @@ int hn70ap_genradio_initialize(void)
spi4 = stm32_spibus_initialize(4);
if (!spi4)
{
spierr("ERROR: FAILED to initialize SPI port 4\n");
_err("ERROR: FAILED to initialize SPI port 4\n");
return -EIO;
}
......
......@@ -97,10 +97,18 @@ class elfreader:
#default value is main nuttx binary
source = "nuttx"
dest = "output_image"
boot = "output_bootloader"
if len(sys.argv) == 2:
if len(sys.argv) > 1:
source = sys.argv[1]
if len(sys.argv) > 2:
dest = sys.argv[2]
if len(sys.argv) > 3:
boot = sys.argv[3]
print("hn70ap_mkupdate starting, source=", source)
elf = elfreader()
elf.open(source)
......@@ -168,14 +176,14 @@ header[1] = (crc >> 16) &0xFF
header[2] = (crc >> 8) &0xFF
header[3] = crc &0xFF
with open('output_image', 'wb') as out:
with open(dest, 'wb') as out:
out.write(header)
out.write(usersoftwr)
print("Wrote output_image")
print("Wrote", dest)
with open('output_bootloader','wb') as out:
with open(boot,'wb') as out:
out.write(bootloader)
print("Wrote output_bootloader")
print("Wrote", boot)
print("all done.")