toos/pic32: Some cosmetic changes.

- Rename the folder to PIC32.
  - Rename the Makefile to Makefile.host
  - Run nxstyle on the C file.
  - Change licenses to ALv2.
This commit is contained in:
Ouss4 2020-03-06 22:39:44 +00:00 committed by patacongo
parent c5b4d9b628
commit 0d88073644
11 changed files with 89 additions and 117 deletions

View File

@ -469,15 +469,15 @@ Loading NuttX with ICD3
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -486,7 +486,7 @@ Loading NuttX with ICD3
To use this file, you need to do the following things:
export PATH=??? # Add the NuttX tools/pic32mx directory to your
export PATH=??? # Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

View File

@ -546,15 +546,15 @@ Creating Compatible NuttX HEX files
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -563,7 +563,7 @@ Creating Compatible NuttX HEX files
To use this file, you need to do the following things:
export PATH=??? # Add the NuttX tools/pic32mx directory to your
export PATH=??? # Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

View File

@ -285,15 +285,15 @@ Creating Compatible NuttX HEX files
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -302,7 +302,7 @@ Creating Compatible NuttX HEX files
To use this file, you need to do the following things:
export PATH=??? # Add the NuttX tools/pic32mx directory to your
export PATH=??? # Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

View File

@ -367,15 +367,15 @@ Loading NuttX with PICkit2
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -384,7 +384,7 @@ Loading NuttX with PICkit2
To use this file, you need to do the following things:
# Add the NuttX tools/pic32mx directory to your
# Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

View File

@ -306,15 +306,15 @@ Loading NuttX with PICkit2
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -323,7 +323,7 @@ Loading NuttX with PICkit2
To use this file, you need to do the following things:
# Add the NuttX tools/pic32mx directory to your
# Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

View File

@ -156,15 +156,15 @@ Creating Compatible NuttX HEX files
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable
file call mkpichex (or mkpichex.exe on

View File

@ -104,15 +104,15 @@ Creating Compatible NuttX HEX files
file to contain physical addresses. But the nuttx.hex file generated from the
top-level make will have address in the KSEG0 and KSEG1 regions.
tools/pic32mx/mkpichex:
tools/pic32/mkpichex:
----------------------
There is a simple tool in the NuttX tools/pic32mx directory that can be
There is a simple tool in the NuttX tools/pic32 directory that can be
used to solve both issues with the nuttx.hex file. But, first, you must
build the tool:
cd tools/pic32mx
make
cd tools/pic32
make -f Makefile.host
Now you will have an executable file call mkpichex (or mkpichex.exe on
Cygwin). This program will take the nutt.hex file as an input, it will
@ -121,7 +121,7 @@ Creating Compatible NuttX HEX files
To use this file, you need to do the following things:
export PATH=??? # Add the NuttX tools/pic32mx directory to your
export PATH=??? # Add the NuttX tools/pic32 directory to your
# PATH variable
make # Build nuttx and nuttx.hex
mkpichex $PWD # Convert addresses in nuttx.hex. $PWD is the path

36
tools/pic32/Makefile.host Normal file
View File

@ -0,0 +1,36 @@
############################################################################
# tools/pic32/Makefile.host
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
############################################################################
all: mkpichex
default: mkpichex
.PHONY: clean
# Add CFLAGS=-g on the make command line to build debug versions
CFLAGS = -O2 -Wall -I.
# mkpichex - Convert virtual addresses in nuttx.hex to physical addresses
mkconfig: mkpichex.c mkpichex.c
@gcc $(CFLAGS) -o mkpichex mkpichex.c
clean:
@rm -f *.o *.a *.dSYM *~ .*.swp
@rm -f mkpichex mkpichex.exe

View File

@ -1,35 +1,20 @@
/****************************************************************************
* tools/pic32mx//mkpichex.c
* tools/pic32/mkpichex.c
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
@ -110,13 +95,14 @@ struct hex_s
* Private Data
****************************************************************************/
static char line[MAX_LINE+1];
static char line[MAX_LINE + 1];
/****************************************************************************
* Private Functions
****************************************************************************/
static inline char *getfilepath(const char *path, const char *name, const char *extension)
static inline char *getfilepath(const char *path, const char *name,
const char *extension)
{
snprintf(line, MAX_LINE, "%s/%s.%s", path, name, extension);
line[MAX_LINE] = '\0';
@ -184,6 +170,7 @@ static unsigned char checksum(chksum_ndx)
{
chksum += (int)get8(&line[ndx]);
}
return (unsigned char)((-chksum) & 0xff);
}
#endif
@ -225,7 +212,8 @@ static void adjust_extlin(struct hex_s *hexline)
/* Then create the new output record */
snprintf(line, MAX_LINE-PAYLOAD_OFFSET, ":02000004%04X%02X\n", segment, chksum);
snprintf(line, MAX_LINE-PAYLOAD_OFFSET, ":02000004%04X%02X\n",
segment, chksum);
}
/****************************************************************************
@ -307,7 +295,6 @@ int main(int argc, char **argv, char **envp)
if (remove(srcfile) != 0)
{
fprintf(stderr, "Failed to remove the old '%s'\n", srcfile);
}
/* Rename the new nuttx.tmp file to nuttx.hex */

View File

@ -1,51 +0,0 @@
############################################################################
# tools/pic32mx//Makefile
#
# Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# 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.
#
############################################################################
all: mkpichex
default: mkpichex
.PHONY: clean
# Add CFLAGS=-g on the make command line to build debug versions
CFLAGS = -O2 -Wall -I.
# mkpichex - Convert virtual addresses in nuttx.hex to physical addresses
mkconfig: mkpichex.c mkpichex.c
@gcc $(CFLAGS) -o mkpichex mkpichex.c
clean:
@rm -f *.o *.a *.dSYM *~ .*.swp
@rm -f mkpichex mkpichex.exe