From d4cc11e13205d6334d8e72dcc8545461b024f584 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 27 Mar 2019 13:38:36 +0700 Subject: [PATCH 01/15] change in file license term from BSD to MIT --- src/boards.c | 58 +++++-------- src/boards.h | 27 ++++-- src/boards/feather_nrf52832.h | 58 +++++-------- src/boards/feather_nrf52840_express.h | 58 +++++-------- src/boards/mdk_nrf52840_dongle.h | 58 +++++-------- src/boards/metro_nrf52840_express.h | 58 +++++-------- src/boards/particle_argon.h | 58 +++++-------- src/boards/particle_boron.h | 58 +++++-------- src/boards/particle_xenon.h | 58 +++++-------- src/boards/pca10056.h | 58 +++++-------- src/boards/pca10059.h | 58 +++++-------- src/dfu_ble_svc.c | 42 +++++++-- src/dfu_init.c | 43 ++++++++-- src/flash_nrf5x.c | 58 +++++-------- src/flash_nrf5x.h | 58 +++++-------- src/license.txt | 117 -------------------------- src/main.c | 34 +++++--- src/pstorage_platform.h | 42 +++++++-- src/usb/msc_uf2.c | 58 +++++-------- src/usb/tusb_config.h | 60 +++++-------- src/usb/usb.c | 58 +++++-------- src/usb/usb_desc.c | 62 +++++--------- src/usb/usb_desc.h | 60 +++++-------- 23 files changed, 536 insertions(+), 763 deletions(-) delete mode 100644 src/license.txt diff --git a/src/boards.c b/src/boards.c index 5c6ba90..22e36f5 100644 --- a/src/boards.c +++ b/src/boards.c @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file boards.c - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include "boards.h" #include "nrf_pwm.h" diff --git a/src/boards.h b/src/boards.h index 37f5f2d..01435a5 100644 --- a/src/boards.h +++ b/src/boards.h @@ -1,14 +1,27 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. +/* + * The MIT License (MIT) * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * Copyright (c) 2018 Ha Thach for Adafruit Industries * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ + #ifndef BOARDS_H #define BOARDS_H diff --git a/src/boards/feather_nrf52832.h b/src/boards/feather_nrf52832.h index be4671a..99e2500 100644 --- a/src/boards/feather_nrf52832.h +++ b/src/boards/feather_nrf52832.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file feather_nrf52832.h - @author hathach - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _FEATHER52832_H #define _FEATHER52832_H diff --git a/src/boards/feather_nrf52840_express.h b/src/boards/feather_nrf52840_express.h index 4d6c998..a5cf389 100644 --- a/src/boards/feather_nrf52840_express.h +++ b/src/boards/feather_nrf52840_express.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file feather_nrf52840_express.h - @author hathach - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _FEATHER52840_H #define _FEATHER52840_H diff --git a/src/boards/mdk_nrf52840_dongle.h b/src/boards/mdk_nrf52840_dongle.h index 0a4d53f..387ee9d 100644 --- a/src/boards/mdk_nrf52840_dongle.h +++ b/src/boards/mdk_nrf52840_dongle.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file mdk_nrf52840_dongle.h - @author gpshead (krypto.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2019, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 gpshead (krypto.org) for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _MDK_NRF52840_DONGLE_H_ #define _MDK_NRF52840_DONGLE_H_ diff --git a/src/boards/metro_nrf52840_express.h b/src/boards/metro_nrf52840_express.h index 10d7745..d7f2afc 100644 --- a/src/boards/metro_nrf52840_express.h +++ b/src/boards/metro_nrf52840_express.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file metro_nrf52840_express.h - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2019, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _METRO_NRF52840_EXPRESS_H_ #define _METRO_NRF52840_EXPRESS_H_ diff --git a/src/boards/particle_argon.h b/src/boards/particle_argon.h index 7c3bd09..6b99c09 100644 --- a/src/boards/particle_argon.h +++ b/src/boards/particle_argon.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file particle_argon.h - @author Scott Shawcroft - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Scott Shawcroft for Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _PARTICLE_ARGON_H #define _PARTICLE_ARGON_H diff --git a/src/boards/particle_boron.h b/src/boards/particle_boron.h index 8ff1959..95124aa 100644 --- a/src/boards/particle_boron.h +++ b/src/boards/particle_boron.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file particle_boron.h - @author Scott Shawcroft - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Scott Shawcroft for Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _PARTICLE_BORON_H #define _PARTICLE_BORON_H diff --git a/src/boards/particle_xenon.h b/src/boards/particle_xenon.h index 97ce92d..123e94f 100644 --- a/src/boards/particle_xenon.h +++ b/src/boards/particle_xenon.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file particle_xenon.h - @author Scott Shawcroft - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Scott Shawcroft for Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _PARTICLE_XENON_H #define _PARTICLE_XENON_H diff --git a/src/boards/pca10056.h b/src/boards/pca10056.h index f09cd2a..f962f31 100644 --- a/src/boards/pca10056.h +++ b/src/boards/pca10056.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file pca10056.h - @author hathach - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2017, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef PCA10056_H #define PCA10056_H diff --git a/src/boards/pca10059.h b/src/boards/pca10059.h index 30c2998..8fe8084 100644 --- a/src/boards/pca10059.h +++ b/src/boards/pca10059.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file pca10059.h - @author hathach - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef PCA10059_H #define PCA10059_H diff --git a/src/dfu_ble_svc.c b/src/dfu_ble_svc.c index f37a167..a4a9d72 100644 --- a/src/dfu_ble_svc.c +++ b/src/dfu_ble_svc.c @@ -1,12 +1,40 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. +/** + * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * All rights reserved. * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. + * 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, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, 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 of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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. * */ diff --git a/src/dfu_init.c b/src/dfu_init.c index f2cd459..3ca0dd4 100644 --- a/src/dfu_init.c +++ b/src/dfu_init.c @@ -1,15 +1,42 @@ -/* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. +/** + * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * All rights reserved. * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. + * 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, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, 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 of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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. * */ - /**@file * * @defgroup nrf_dfu_init_template Template file with an DFU init packet handling example. diff --git a/src/flash_nrf5x.c b/src/flash_nrf5x.c index 9145a31..931b89e 100644 --- a/src/flash_nrf5x.c +++ b/src/flash_nrf5x.c @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file flash_nrf5x.c - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include #include "nrf_sdm.h" diff --git a/src/flash_nrf5x.h b/src/flash_nrf5x.h index a86dc34..ef17adf 100644 --- a/src/flash_nrf5x.h +++ b/src/flash_nrf5x.h @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file flash_nrf5x.h - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef FLASH_NRF5X_H_ #define FLASH_NRF5X_H_ diff --git a/src/license.txt b/src/license.txt deleted file mode 100644 index 2ffb212..0000000 --- a/src/license.txt +++ /dev/null @@ -1,117 +0,0 @@ -This text contains two licenses (License #1, License #2). -License #1 applies to the whole SDK, except i) files including Dynastream copyright notices and ii) source files including BSD 3-clause license texts. -License #2 applies only to files including Dynastream copyright notices. -All must be read and accepted before proceeding. - - -License #1 - -License Agreement -Nordic Semiconductor ASA (“Nordic”) -Software Development Kit - - -You (“You” or “Licensee”) must carefully and thoroughly read this License Agreement (“Agreement”), and accept to adhere to this Agreement before downloading, installing and/or using any software or content in the Software Development Kit (“SDK”) provided herewith. - -YOU ACCEPT THIS LICENSE AGREEMENT BY (A) CLICKING ACCEPT OR AGREE TO THIS LICENSE AGREEMENT, WHERE THIS OPTION IS MADE AVAILABLE TO YOU; OR (B) BY ACTUALLY USING THE SDK, IN THIS CASE YOU AGREE THAT THE USE OF THE SDK CONSTITUTES ACCEPTANCE OF THE LICENSING AGREEMENT FROM THAT POINT ONWARDS. - -IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL/COMPLETE INSTALLATION OF, OR IN ANY OTHER WAY MAKE USE OF THE SDK OR RELATED CONTENT. - - -1. Grant of License -Subject to the terms in this Agreement Nordic grants Licensee a limited, non-exclusive, non-transferable, non-sub licensable, revocable license (“License”): (a) to use the SDK as a development platform solely in connection with a Nordic Integrated Circuit (“nRF IC”), (b) to modify any source code contained in the SDK solely as necessary to implement products developed by Licensee that incorporate an nRF IC (“Licensee Product”), and (c) to distribute the SDK solely as implemented in Licensee Product. Licensee shall not use the SDK for any purpose other than specifically authorized herein. - -2. Title -As between the parties, Nordic retains full rights, title, and ownership of the SDK and any and all patents, copyrights, trade secrets, trade names, trademarks, and other intellectual property rights in and to the SDK. - -3. No Modifications or Reverse Engineering -Licensee shall not, modify, reverse engineer, disassemble, decompile or otherwise attempt to discover the source code of any non-source code parts of the SDK including, but not limited to pre-compiled binaries and object code. - -4. Distribution Restrictions -Except as set forward in Section 1 above, the Licensee may not disclose or distribute any or all parts of the SDK to any third party. Licensee agrees to provide reasonable security precautions to prevent unauthorized access to or use of the SDK as proscribed herein. Licensee also agrees that use of and access to the SDK will be strictly limited to the employees and subcontractors of the Licensee necessary for the performance of development, verification and production tasks under this Agreement. The Licensee is responsible for making such employees and subcontractors agree on complying with the obligations concerning use and non-disclosure of the SDK. - -5. No Other Rights -Licensee shall use the SDK only in compliance with this Agreement and shall refrain from using the SDK in any way that may be contrary to this Agreement. - - -6. Fees -Nordic grants the License to the Licensee free of charge provided that the Licensee undertakes the obligations in the Agreement and warrants to comply with the Agreement. - - -7. DISCLAIMER OF WARRANTY -THE SDK IS PROVIDED “AS IS" WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED AND NEITHER NORDIC, ITS LICENSORS OR AFFILIATES NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR THAT THE SDK WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THERE IS NO WARRANTY BY NORDIC OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SDK WILL MEET THE REQUIREMENTS OF LICENSEE OR THAT THE OPERATION OF THE SDK WILL BE UNINTERRUPTED OR ERROR-FREE. LICENSEE ASSUMES ALL RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SDK TO ACHIEVE LICENSEE’S INTENDED RESULTS AND FOR THE INSTALLATION, USE AND RESULTS OBTAINED FROM IT. - -8. No Support -Nordic is not obligated to furnish or make available to Licensee any further information, software, technical information, know-how, show-how, bug-fixes or support. Nordic reserves the right to make changes to the SDK without further notice. - -9. Limitation of Liability -In no event shall Nordic, its employees or suppliers or affiliates be liable for any lost profits, revenue, sales, data or costs of procurement of substitute goods or services, property damage, personal injury, interruption of business, loss of business information or for any special, direct, indirect, incidental, economic, punitive, special or consequential damages, however caused and whether arising under contract, tort, negligence, or other theory of liability arising out of the use of or inability to use the SDK, even if Nordic or its employees or suppliers or affiliates are advised of the possibility of such damages. Because some countries/states/ jurisdictions do not allow the exclusion or limitation of liability, but may allow liability to be limited, in such cases, Nordic, its employees or licensors or affiliates’ liability shall be limited to USD 50. - -10. Breach of Contract -Upon a breach of contract by the Licensee, Nordic is entitled to damages in respect of any direct loss which can be reasonably attributed to the breach by the Licensee. If the Licensee has acted with gross negligence or willful misconduct, the Licensee shall cover both direct and indirect costs for Nordic. - -11. Indemnity - -Licensee undertakes to indemnify, hold harmless and defend Nordic and its directors, officers, affiliates, shareholders, employees and agents from and against any claims or lawsuits, including attorney's fees, that arise or result of the Licensee’s execution of the License and which is not due to causes for which Nordic is responsible. - -12. Governing Law -This Agreement shall be construed according to the laws of Norway, and hereby submits to the exclusive jurisdiction of the Oslo tingrett. - -13. Assignment -Licensee shall not assign this Agreement or any rights or obligations hereunder without the prior written consent of Nordic. - -14. Termination -Without prejudice to any other rights, Nordic may cancel this Agreement if Licensee does not abide by the terms and conditions of this Agreement. Upon termination Licensee must promptly cease the use of the License and destroy all copies of the Licensed Technology and any other material provided by Nordic or its affiliate, or produced by the Licensee in connection with the Agreement or the Licensed Technology. - - -License #2 - -This software is subject to the ANT+ Shared Source License -www.thisisant.com/swlicenses -Copyright (c) Dynastream Innovations, Inc. 2015 -All rights reserved. - -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 of Dynastream nor the names of its - contributors may be used to endorse or promote products - derived from this software without specific prior - written permission. - -The following actions are prohibited: - - 1) Redistribution of source code containing the ANT+ Network - Key. The ANT+ Network Key is available to ANT+ Adopters. - Please refer to http://thisisant.com to become an ANT+ - Adopter and access the key. - - 2) Reverse engineering, decompilation, and/or disassembly of - software provided in binary form under this license. - -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 HEREBY -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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; DAMAGE TO ANY DEVICE, 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. SOME STATES DO NOT ALLOW -THE EXCLUSION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE -ABOVE LIMITATIONS MAY NOT APPLY TO YOU. diff --git a/src/main.c b/src/main.c index 8ac1dba..38581d4 100644 --- a/src/main.c +++ b/src/main.c @@ -1,22 +1,28 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. +/* + * The MIT License (MIT) * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * Copyright (c) 2018 Ha Thach for Adafruit Industries * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. */ -/**@file - * - * @defgroup ble_sdk_app_bootloader_main main.c - * @{ - * @ingroup dfu_bootloader_api - * @brief Bootloader project main file. - * +/** * -# Receive start data packet. * -# Based on start packet, prepare NVM area to store received data. * -# Receive data packet. diff --git a/src/pstorage_platform.h b/src/pstorage_platform.h index a3ac5c6..bbc573c 100644 --- a/src/pstorage_platform.h +++ b/src/pstorage_platform.h @@ -1,12 +1,40 @@ -/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. +/** + * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA * - * The information contained herein is property of Nordic Semiconductor ASA. - * Terms and conditions of usage are described in detail in NORDIC - * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. + * All rights reserved. * - * Licensees are granted free, non-transferable use of the information. NO - * WARRANTY of ANY KIND is provided. This heading must NOT be removed from - * the file. + * 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, except as embedded into a Nordic + * Semiconductor ASA integrated circuit in a product or a software update for + * such product, 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 of Nordic Semiconductor ASA nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * 4. This software, with or without modification, must only be used with a + * Nordic Semiconductor ASA integrated circuit. + * + * 5. Any software provided in binary form under this license must not be reverse + * engineered, decompiled, modified and/or disassembled. + * + * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA 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. * */ diff --git a/src/usb/msc_uf2.c b/src/usb/msc_uf2.c index 977ca6c..11876b1 100644 --- a/src/usb/msc_uf2.c +++ b/src/usb/msc_uf2.c @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file msc_uf2.c - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include "tusb.h" #include "uf2/uf2.h" diff --git a/src/usb/tusb_config.h b/src/usb/tusb_config.h index 6acfda1..59f06fb 100644 --- a/src/usb/tusb_config.h +++ b/src/usb/tusb_config.h @@ -1,40 +1,26 @@ -/**************************************************************************/ -/*! - @file tusb_config.h - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2013, hathach (tinyusb.org) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. - - This file is part of the tinyusb stack. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef _TUSB_CONFIG_H_ #define _TUSB_CONFIG_H_ diff --git a/src/usb/usb.c b/src/usb/usb.c index b5baee6..21df788 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -1,38 +1,26 @@ -/**************************************************************************/ -/*! - @file usb.c - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include "nrfx.h" #include "nrfx_power.h" diff --git a/src/usb/usb_desc.c b/src/usb/usb_desc.c index 4e5f5a3..0ec0c13 100644 --- a/src/usb/usb_desc.c +++ b/src/usb/usb_desc.c @@ -1,42 +1,26 @@ -/**************************************************************************/ -/*! - @file usb_desc.c - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2013, hathach (tinyusb.org) - Copyright (c) 2018, Adafruit Industries (adafruit.com) - - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. - - This file is part of the tinyusb stack. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include "usb_desc.h" diff --git a/src/usb/usb_desc.h b/src/usb/usb_desc.h index b81946a..c0d6dce 100644 --- a/src/usb/usb_desc.h +++ b/src/usb/usb_desc.h @@ -1,40 +1,26 @@ -/**************************************************************************/ -/*! - @file usb_desc.h - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2013, hathach (tinyusb.org) - Copyright (c) 2018, Adafruit Industries (adafruit.com) - - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2018 Ha Thach for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef USB_DESC_H_ #define USB_DESC_H_ From bcbd3fa089b47a11b8d8fd11fcd47704f6cfd4f9 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 12:03:26 +0700 Subject: [PATCH 02/15] enhance board management --- Makefile | 42 ++----------- src/boards.c | 10 ++++ src/boards.h | 14 +---- .../board.h} | 60 ++++++++----------- .../board.h} | 6 +- .../board.h} | 6 +- .../board.h} | 0 .../board.h} | 6 +- .../board.h} | 0 .../board.h} | 0 .../board.h} | 0 src/boards/{pca10056.h => pca10056/board.h} | 0 src/boards/{pca10059.h => pca10059/board.h} | 0 tools/build_all.py | 6 +- 14 files changed, 54 insertions(+), 96 deletions(-) rename src/boards/{electronut_labs_papyr.h => electronut_labs_papyr/board.h} (66%) rename src/boards/{feather_nrf52832.h => feather_nrf52832/board.h} (93%) rename src/boards/{feather_nrf52840_express.h => feather_nrf52840_express/board.h} (94%) rename src/boards/{mdk_nrf52840_dongle.h => mdk_nrf52840_dongle/board.h} (100%) rename src/boards/{metro_nrf52840_express.h => metro_nrf52840_express/board.h} (95%) rename src/boards/{particle_argon.h => particle_argon/board.h} (100%) rename src/boards/{particle_boron.h => particle_boron/board.h} (100%) rename src/boards/{particle_xenon.h => particle_xenon/board.h} (100%) rename src/boards/{pca10056.h => pca10056/board.h} (100%) rename src/boards/{pca10059.h => pca10059/board.h} (100%) diff --git a/Makefile b/Makefile index 6dbaf98..4d3b2e9 100644 --- a/Makefile +++ b/Makefile @@ -80,22 +80,15 @@ remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-ou #********************************* # Select the board to build #********************************* -BOARD_LIST = $(sort $(subst .h,,$(subst src/boards/,,$(wildcard src/boards/*.h)))) +BOARD_LIST = $(sort $(subst .h,,$(subst src/boards/,,$(wildcard src/boards/*)))) NRF52832_BOARDLIST = feather_nrf52832 IS_52832 = $(filter $(BOARD),$(NRF52832_BOARDLIST)) -ifeq ($(filter $(MAKECMDGOALS),all-board help),) - ifeq ($(BOARD),) - $(info You must provide a BOARD parameter with 'BOARD=') - $(info Supported boards are: $(BOARD_LIST)) - $(info Run 'make help' for usage) - $(error BOARD not defined) - else - ifeq ($(filter $(BOARD),$(BOARD_LIST)),) - $(error Invalid BOARD specified) - endif - endif +ifeq ($(filter $(BOARD),$(BOARD_LIST)),) + $(info You must provide a BOARD parameter with 'BOARD='. Supported boards are:) + $(info $(BOARD_LIST)) + $(error Invalid BOARD specified) endif BUILD = _build-$(BOARD) @@ -267,7 +260,7 @@ CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096 CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"' CFLAGS += -DBOARD_$(shell echo $(BOARD) | tr '[:lower:]' '[:upper:]') -CFLAGS += -DBOARD_HEADER_FILE='"$(BOARD).h"' +CFLAGS += -DBOARD_HEADER_FILE='"$(BOARD)/board.h"' ifneq ($(IS_52832),) CFLAGS += -DNRF52 @@ -348,29 +341,6 @@ endif # default target to build all: $(BUILD)/$(OUTPUT_FILENAME)-nosd.out size -# Rule using BOARD_LIST, nl is newline -define nl - - -endef - -_make_board = $(MAKE) -s -f $(MAKEFILE_LIST) -e BOARD=$1 $2 $(nl) -_make_all_board = $(foreach b,$(BOARD_LIST), $(call _make_board,$b,$1)) - -# build all the boards -all-board: - $(call _make_all_board,clean all) - -help: - @echo To compile and build the current code for a board - @echo $$ make BOARD=feather_nrf52840_express all - @echo - @echo To flash current code using Jlink - @echo $$ make BOARD=feather_nrf52840_express flash - @echo - @echo To flash current code using existing bootloader dfu - @echo $$ make BOARD=feather_nrf52840_express SERIAL=/dev/ttyACM0 dfu-flash - #******************* Flash target ******************* check_defined = \ diff --git a/src/boards.c b/src/boards.c index 22e36f5..44890ed 100644 --- a/src/boards.c +++ b/src/boards.c @@ -38,6 +38,16 @@ #endif //------------- IMPLEMENTATION -------------// +void button_init(uint32_t pin) +{ + nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); +} + +bool button_pressed(uint32_t pin) +{ + return (nrf_gpio_pin_read(pin) == 0) ? true : false; +} + void board_init(void) { // stop LF clock just in case we jump from application without reset diff --git a/src/boards.h b/src/boards.h index 01435a5..1358df0 100644 --- a/src/boards.h +++ b/src/boards.h @@ -30,6 +30,7 @@ #include #include "nrf_gpio.h" + #include BOARD_HEADER_FILE #ifndef BUTTON_DFU @@ -68,8 +69,6 @@ void board_teardown(void); // LED //--------------------------------------------------------------------+ -#define bit(b) (1UL << (b)) - enum { STATE_BOOTLOADER_STARTED = 0, STATE_USB_MOUNTED, @@ -97,15 +96,8 @@ void led_tick(void); #error "At least two buttons required in the BSP (see 'BUTTONS_NUMBER')" #endif -static inline void button_init(uint32_t pin) -{ - nrf_gpio_cfg_sense_input(pin, BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); -} - -static inline bool button_pressed(uint32_t pin) -{ - return (nrf_gpio_pin_read(pin) == 0) ? true : false; -} +void button_init(uint32_t pin); +bool button_pressed(uint32_t pin); bool is_ota(void); diff --git a/src/boards/electronut_labs_papyr.h b/src/boards/electronut_labs_papyr/board.h similarity index 66% rename from src/boards/electronut_labs_papyr.h rename to src/boards/electronut_labs_papyr/board.h index 8911584..ab7588c 100644 --- a/src/boards/electronut_labs_papyr.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -1,38 +1,28 @@ -/**************************************************************************/ -/*! - @file elelctronutlabs_papyr.h - @author Tavish Naruka - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2017, Adafruit Industries (adafruit.com) - All rights reserved. - - 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 of the copyright holders 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 ''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 HOLDER 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. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * @author Tavish Naruka + * + * Copyright (c) 2018 Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #ifndef PAPYR_H #define PAPYR_H diff --git a/src/boards/feather_nrf52832.h b/src/boards/feather_nrf52832/board.h similarity index 93% rename from src/boards/feather_nrf52832.h rename to src/boards/feather_nrf52832/board.h index 99e2500..ee70cdc 100644 --- a/src/boards/feather_nrf52832.h +++ b/src/boards/feather_nrf52832/board.h @@ -22,8 +22,8 @@ * THE SOFTWARE. */ -#ifndef _FEATHER52832_H -#define _FEATHER52832_H +#ifndef _FEATHER_NRF52832_H +#define _FEATHER_NRF52832_H /*------------------------------------------------------------------*/ /* LED @@ -56,4 +56,4 @@ #define PRODUCT_NAME "Adafruit Bluefruit Feather nRF52832" -#endif // _FEATHER52832_H +#endif // _FEATHER_NRF52832_H diff --git a/src/boards/feather_nrf52840_express.h b/src/boards/feather_nrf52840_express/board.h similarity index 94% rename from src/boards/feather_nrf52840_express.h rename to src/boards/feather_nrf52840_express/board.h index a5cf389..9b9631e 100644 --- a/src/boards/feather_nrf52840_express.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -22,8 +22,8 @@ * THE SOFTWARE. */ -#ifndef _FEATHER52840_H -#define _FEATHER52840_H +#ifndef _FEATHER_NRF52840_H +#define _FEATHER_NRF52840_H #define _PINNUM(port, pin) ((port)*32 + (pin)) @@ -61,4 +61,4 @@ #define PRODUCT_NAME "Adafruit Feather nRF52840 Express" #define VOLUME_LABEL "FTHR840BOOT" -#endif // _FEATHER52840_H +#endif // _FEATHER_NRF52840_H diff --git a/src/boards/mdk_nrf52840_dongle.h b/src/boards/mdk_nrf52840_dongle/board.h similarity index 100% rename from src/boards/mdk_nrf52840_dongle.h rename to src/boards/mdk_nrf52840_dongle/board.h diff --git a/src/boards/metro_nrf52840_express.h b/src/boards/metro_nrf52840_express/board.h similarity index 95% rename from src/boards/metro_nrf52840_express.h rename to src/boards/metro_nrf52840_express/board.h index d7f2afc..1fc5b02 100644 --- a/src/boards/metro_nrf52840_express.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -22,8 +22,8 @@ * THE SOFTWARE. */ -#ifndef _METRO_NRF52840_EXPRESS_H_ -#define _METRO_NRF52840_EXPRESS_H_ +#ifndef _METRO_NRF52840_H_ +#define _METRO_NRF52840_H_ #define _PINNUM(port, pin) ((port)*32 + (pin)) @@ -62,4 +62,4 @@ #define VOLUME_LABEL "METR840BOOT" -#endif /* _METRO_NRF52840_EXPRESS_H_ */ +#endif /* _METRO_NRF52840_H_ */ diff --git a/src/boards/particle_argon.h b/src/boards/particle_argon/board.h similarity index 100% rename from src/boards/particle_argon.h rename to src/boards/particle_argon/board.h diff --git a/src/boards/particle_boron.h b/src/boards/particle_boron/board.h similarity index 100% rename from src/boards/particle_boron.h rename to src/boards/particle_boron/board.h diff --git a/src/boards/particle_xenon.h b/src/boards/particle_xenon/board.h similarity index 100% rename from src/boards/particle_xenon.h rename to src/boards/particle_xenon/board.h diff --git a/src/boards/pca10056.h b/src/boards/pca10056/board.h similarity index 100% rename from src/boards/pca10056.h rename to src/boards/pca10056/board.h diff --git a/src/boards/pca10059.h b/src/boards/pca10059/board.h similarity index 100% rename from src/boards/pca10059.h rename to src/boards/pca10059/board.h diff --git a/tools/build_all.py b/tools/build_all.py index 1d5419a..5411a76 100644 --- a/tools/build_all.py +++ b/tools/build_all.py @@ -17,11 +17,7 @@ exit_status = 0 all_boards = [] for entry in os.scandir("src/boards"): - if not entry.name.endswith(".h"): - print("Misplaced file in src/boards: {}\n".format(entry.name)) - exit_status = 1 - continue - all_boards.append(entry.name[:-2]) + all_boards.append(entry.name) #sha, version = build_info.get_version_info() From ca400565b3ba7183a08de79df257f7a32a6c3754 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 12:08:58 +0700 Subject: [PATCH 03/15] clean up --- Makefile | 3 ++- src/boards.h | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4d3b2e9..8c74c35 100644 --- a/Makefile +++ b/Makefile @@ -194,6 +194,8 @@ endif # src IPATH += $(SRC_PATH) +IPATH += $(SRC_PATH)/boards/$(BOARD) + IPATH += $(SRC_PATH)/cmsis/include IPATH += $(SRC_PATH)/usb IPATH += $(SRC_PATH)/boards @@ -260,7 +262,6 @@ CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096 CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"' CFLAGS += -DBOARD_$(shell echo $(BOARD) | tr '[:lower:]' '[:upper:]') -CFLAGS += -DBOARD_HEADER_FILE='"$(BOARD)/board.h"' ifneq ($(IS_52832),) CFLAGS += -DNRF52 diff --git a/src/boards.h b/src/boards.h index 1358df0..cd1760b 100644 --- a/src/boards.h +++ b/src/boards.h @@ -30,8 +30,7 @@ #include #include "nrf_gpio.h" - -#include BOARD_HEADER_FILE +#include "board.h" #ifndef BUTTON_DFU #define BUTTON_DFU BUTTON_1 From 69a1b555e4848b1016c683c9d180e8f1e09f0cbc Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 12:23:11 +0700 Subject: [PATCH 04/15] force NFC as GPIO --- Makefile | 6 +----- README.md | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 8c74c35..3b767da 100644 --- a/Makefile +++ b/Makefile @@ -101,8 +101,6 @@ SD_NAME = s140 DFU_DEV_REV = 52840 endif - - #****************************************************************************** # SOURCE FILES #****************************************************************************** @@ -252,8 +250,8 @@ CFLAGS += -DMK_BOOTLOADER_VERSION=0x0$(SD_VER1)0$(SD_VER2)0$(SD_VER3)UL CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -DCONFIG_GPIO_AS_PINRESET +CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS CFLAGS += -DBLE_STACK_SUPPORT_REQD -CFLAGS += -DBSP_DEFINES_ONLY CFLAGS += -DSWI_DISABLE0 CFLAGS += -DSOFTDEVICE_PRESENT CFLAGS += -DFLOAT_ABI_HARD @@ -296,9 +294,7 @@ LDFLAGS += --specs=nano.specs -lc -lnosys #****************************************************************************** ASMFLAGS += -x assembler-with-cpp ASMFLAGS += -D__HEAP_SIZE=0 -ASMFLAGS += -DCONFIG_GPIO_AS_PINRESET ASMFLAGS += -DBLE_STACK_SUPPORT_REQD -ASMFLAGS += -DBSP_DEFINES_ONLY ASMFLAGS += -DSWI_DISABLE0 ASMFLAGS += -DSOFTDEVICE_PRESENT ASMFLAGS += -DFLOAT_ABI_HARD diff --git a/README.md b/README.md index 6834ac0..967c2df 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ This is a CDC/DFU/UF2 bootloader for nRF52 boards. - [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406) - [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) +- [Electronut Labs Papyr](https://docs.electronut.in/papyr/) +- MakerDiary MDK nRF52840 USB Dongle - Nordic nRF52840DK PCA10056 - Nordic nRF52840DK PCA10059 ("Dongle") - Particle Argon - Particle Boron - Particle Xenon -- MakerDiary MDK nRF52840 USB Dongle -- [Electronut Labs Papyr](https://docs.electronut.in/papyr/) UF2 is an easy-to-use bootloader that appears as a flash drive. You can just copy `.uf2`-format application images to the flash drive to load new firmware. From 3fec038ed87febc20e50fdfa1bbd93d678b24be2 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 12:26:26 +0700 Subject: [PATCH 05/15] remove ARRAY_SIZE2 since bootloader is only built with C --- src/usb/uf2/ghostfat.c | 4 +- src/usb/uf2/macros.h | 143 ----------------------------------------- 2 files changed, 2 insertions(+), 145 deletions(-) diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 6307b8b..b643787 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -89,10 +89,10 @@ static struct TextFile const info[] = { // WARNING -- code presumes each non-UF2 file content fits in single sector // Cannot programmatically statically assert .content length // for each element above. -STATIC_ASSERT(ARRAY_SIZE2(indexFile) < 512); +STATIC_ASSERT(ARRAY_SIZE(indexFile) < 512); -#define NUM_FILES (ARRAY_SIZE2(info)) +#define NUM_FILES (ARRAY_SIZE(info)) #define NUM_DIRENTRIES (NUM_FILES + 1) // Code adds volume label as first root directory entry diff --git a/src/usb/uf2/macros.h b/src/usb/uf2/macros.h index bcc27aa..6be46a4 100644 --- a/src/usb/uf2/macros.h +++ b/src/usb/uf2/macros.h @@ -26,149 +26,6 @@ SOFTWARE. */ -#ifndef ARRAYSIZE2_H -#define ARRAYSIZE2_H - -#ifndef __has_feature - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#if __cplusplus >= 199711L - #pragma message "using Ivan J. Johnson's ARRAY_SIZE2" - - // Works on older compilers, even Visual C++ 6.... - // Created by Ivan J. Johnson, March 06, 2007 - // See http://drdobbs.com/cpp/197800525?pgno=1 - // - // Pseudocode: - // if x is not an array - // issue a compile-time error - // else - // use the traditional (non-typesafe) C99 COUNTOF expression - // - // If the argument is any of: - // object of class type, such as an std::vector - // floating-point type - // function pointer - // pointer-to-member - // then the first reinterpret_cast<> is not legal (compiler error) - // - // The type for check1 is chosen and named to help understand - // the cause of the error, because the class name is likely to - // appear in the compiler error message. - // - // If check1 succeeds, then the argument must be one of: - // an integral type - // an enumerated type - // a pointer to an object - // an array - // - // Check2 expands approximately to sizeof(check_type(x, &x)), - // where check_type is an overloaded function. - // Because this is purely a compile-time computation, - // the function is never really called or even implemented, - // but it lets the compiler apply overload resolution, - // which allows further type discrimination. - // There are three possibilities to consider: - // x is an integral type or enumerated type. - // In this case, neither of the two function overloads - // is a match, resulting in a compiler error. - // x is a pointer to an object. - // In this case, the first argument to check_type() - // is a pointer and the second one is a pointer-to-pointer. - // The best function match is the first overload of check_type, - // the one that returns an incomplete type (Is_pointer). - // However, because Is_pointer is an incomplete type, - // sizeof(Is_pointer) is not a valid expression, - // resulting in a compiler error. - // x is an array. - // In this case, the first argument to check_type() - // is an array and the second is a pointer-to-array. - // A pointer-to-array is *NOT* convertible to a - // pointer-to-pointer, so the first overload of - // check_type() is not a match. - // However, an array IS convertible to a pointer, - // and a pointer-to-array already is a pointer. - // Any pointer is convertible to a void*, - // so the second function overload is a match. - // That overload returns a complete type (Is_array). - // Because it's a complete type, - // sizeof(Is_array) is a valid expression. - // Thus, the compiler has EXCLUDED every possible type - // except arrays via compilation errors before reaching - // the third line. - // Moreover, check1 and check2 are reduced to the value zero, - // while the third line is the old type-unsafe C-style macro, - // now made entirely type-safe. - // - // Additional benefits: - // The result is itself constexpr - // - // - #define ARRAY_SIZE2(arr) ( \ - 0 * sizeof(reinterpret_cast(arr)) + /*check1*/ \ - 0 * sizeof(::Bad_arg_to_COUNTOF::check_type((arr), &(arr))) + /*check2*/ \ - sizeof(arr) / sizeof((arr)[0]) /* eval */ \ - ) - - struct Bad_arg_to_COUNTOF { - class Is_pointer; // incomplete - class Is_array {}; - template - static Is_pointer check_type(const T*, const T* const*); - static Is_array check_type(const void*, const void*); - }; - -#elif __cplusplus >= 201103L || /* any compiler claiming C++11 support */ \ - _MSC_VER >= 1900 || /* Visual C++ 2015 or higher */ \ - __has_feature(cxx_constexpr) /* CLang versions supporting constexp */ - - #pragma message "C++11 version ARRAY_SIZE2" - - namespace detail - { - template - constexpr std::size_t countof(T const (&)[N]) noexcept - { - return N; - } - } // namespace detail - #define ARRAY_SIZE2(arr) detail::countof(arr) - -#elif _MSC_VER // Visual C++ fallback - - #pragma message "using Microsoft Visual C++ intrinsic ARRAY_SIZE2" - #define ARRAY_SIZE2(arr) _countof(arr) - -#elif __cplusplus >= 199711L && ( /* C++ 98 trick */ \ - defined(__INTEL_COMPILER) || \ - defined(__clang__) || \ - (defined(__GNUC__) && ( \ - (__GNUC__ > 4) || \ - (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ - ))) - - #pragma message "C++98 version ARRAY_SIZE2" - - template - char(&_ArraySizeHelperRequiresArray(T(&)[N]))[N]; - #define ARRAY_SIZE2(x) sizeof(_ArraySizeHelperRequiresArray(x)) - -#else - - #pragma message "Using type-unsafe version of ARRAY_SIZE2" - // This is the worst-case scenario macro. - // While it is valid C, it is NOT typesafe. - // For example, if the parameter arr is a pointer instead of array, - // the compiler will SILENTLY give a (likely) incorrect result. - #define ARRAY_SIZE2(arr) sizeof(arr) / sizeof(arr[0]) - -#endif - - -#endif // ARRAYSIZE2_H - - #ifndef COMPILE_DATE_H #define COMPILE_DATE_H From 9a0ee51d915b8b51f25acce931d3d8039b0ab5c4 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 12:31:09 +0700 Subject: [PATCH 06/15] rename macros.h to compile_date.h --- src/usb/uf2/{macros.h => compile_date.h} | 0 src/usb/uf2/ghostfat.c | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename src/usb/uf2/{macros.h => compile_date.h} (100%) diff --git a/src/usb/uf2/macros.h b/src/usb/uf2/compile_date.h similarity index 100% rename from src/usb/uf2/macros.h rename to src/usb/uf2/compile_date.h diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index b643787..5d0deb2 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -1,5 +1,4 @@ - -#include "macros.h" +#include "compile_date.h" #include "uf2.h" #include "flash_nrf5x.h" From 4ec938230dca766e39f72498dd4dbe1b56a17844 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 16:15:59 +0700 Subject: [PATCH 07/15] update uf2 BOARD_ID --- Makefile | 1 - src/boards/electronut_labs_papyr/board.h | 2 +- src/boards/feather_nrf52840_express/board.h | 1 + src/boards/mdk_nrf52840_dongle/board.h | 2 +- src/boards/metro_nrf52840_express/board.h | 1 + src/boards/particle_argon/board.h | 2 +- src/boards/particle_boron/board.h | 2 +- src/boards/particle_xenon/board.h | 2 +- src/boards/pca10056/board.h | 2 ++ src/boards/pca10059/board.h | 2 ++ src/usb/uf2/ghostfat.c | 3 +-- src/usb/uf2/uf2cfg.h | 4 ---- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 3b767da..683be6b 100644 --- a/Makefile +++ b/Makefile @@ -259,7 +259,6 @@ CFLAGS += -DMK_DIS_FIRMWARE='$(MK_DIS_FIRMWARE)' CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096 CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"' -CFLAGS += -DBOARD_$(shell echo $(BOARD) | tr '[:lower:]' '[:upper:]') ifneq ($(IS_52832),) CFLAGS += -DNRF52 diff --git a/src/boards/electronut_labs_papyr/board.h b/src/boards/electronut_labs_papyr/board.h index ab7588c..0dc1a5e 100644 --- a/src/boards/electronut_labs_papyr/board.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -60,7 +60,7 @@ #define DIS_MANUFACTURER "Electronut Labs" #define DIS_MODEL "Papyr" -#define BOARD_ID "Electronut Labs Papyr" +#define UF2_BOARD_ID "Electronut Labs Papyr" #define INDEX_URL "https://docs.electronut.in/papyr" #define USB_DESC_VID 0x239A diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 9b9631e..7f16a32 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -60,5 +60,6 @@ #define PRODUCT_NAME "Adafruit Feather nRF52840 Express" #define VOLUME_LABEL "FTHR840BOOT" +#define UF2_BOARD_ID "nRF52840-Feather-revD" #endif // _FEATHER_NRF52840_H diff --git a/src/boards/mdk_nrf52840_dongle/board.h b/src/boards/mdk_nrf52840_dongle/board.h index 387ee9d..e35d31f 100644 --- a/src/boards/mdk_nrf52840_dongle/board.h +++ b/src/boards/mdk_nrf52840_dongle/board.h @@ -55,7 +55,7 @@ #define PRODUCT_NAME "MDK nRF52840 USB Dongle" #define VOLUME_LABEL "MDK840DONGL" -#define BOARD_ID "MakerDiary-nRF52840-USB-Dongle" +#define UF2_BOARD_ID "MakerDiary-nRF52840-USB-Dongle" #define INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index 1fc5b02..033ab1c 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -60,6 +60,7 @@ #define PRODUCT_NAME "Adafruit Metro nRF52840 Express" #define VOLUME_LABEL "METR840BOOT" +#define UF2_BOARD_ID "nRF52840-Metro-revA" #endif /* _METRO_NRF52840_H_ */ diff --git a/src/boards/particle_argon/board.h b/src/boards/particle_argon/board.h index 6b99c09..3e0a9f7 100644 --- a/src/boards/particle_argon/board.h +++ b/src/boards/particle_argon/board.h @@ -62,7 +62,7 @@ #define VOLUME_LABEL "ARGONBOOT " -#define BOARD_ID "Particle-Argon-v1" +#define UF2_BOARD_ID "nRF52840-Argon-v1" #define INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/particle_boron/board.h b/src/boards/particle_boron/board.h index 95124aa..6209136 100644 --- a/src/boards/particle_boron/board.h +++ b/src/boards/particle_boron/board.h @@ -62,7 +62,7 @@ #define VOLUME_LABEL "BORONBOOT " -#define BOARD_ID "Particle-Boron-v1" +#define UF2_BOARD_ID "nRF52840-Boron-v1" #define INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/particle_xenon/board.h b/src/boards/particle_xenon/board.h index 123e94f..6b9cbf0 100644 --- a/src/boards/particle_xenon/board.h +++ b/src/boards/particle_xenon/board.h @@ -62,7 +62,7 @@ #define VOLUME_LABEL "XENONBOOT " -#define BOARD_ID "Particle-Xenon-v1" +#define UF2_BOARD_ID "nRF52840-Xenon-v1" #define INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h index f962f31..1c0aa7b 100644 --- a/src/boards/pca10056/board.h +++ b/src/boards/pca10056/board.h @@ -54,4 +54,6 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10056" +#define UF2_BOARD_ID "nRF52840-pca10056-v1" + #endif // PCA10056_H diff --git a/src/boards/pca10059/board.h b/src/boards/pca10059/board.h index 8fe8084..a2d76d8 100644 --- a/src/boards/pca10059/board.h +++ b/src/boards/pca10059/board.h @@ -57,4 +57,6 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10059" +#define UF2_BOARD_ID "nRF52840-pca10059-v1" + #endif // PCA10059_H diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 5d0deb2..bf39999 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -63,8 +63,7 @@ struct TextFile { const char infoUf2File[] = // "UF2 Bootloader " UF2_VERSION "\r\n" "Model: " PRODUCT_NAME "\r\n" - "Board-ID: " BOARD_ID "\r\n" - "Bootloader: " BOOTLOADER_ID "\r\n" + "Board-ID: " UF2_BOARD_ID "\r\n" "Date: " __DATE__ "\r\n"; const char indexFile[] = // diff --git a/src/usb/uf2/uf2cfg.h b/src/usb/uf2/uf2cfg.h index 0229a20..6042b67 100644 --- a/src/usb/uf2/uf2cfg.h +++ b/src/usb/uf2/uf2cfg.h @@ -4,10 +4,6 @@ #define PRODUCT_NAME DIS_MODEL #endif -#ifndef BOARD_ID -#define BOARD_ID "NRF52-Bluefruit-v0" -#endif - #ifndef INDEX_URL #define INDEX_URL "https://www.adafruit.com/" #endif From 137785f2f08bc2bcaddb7710bf8c8bb3c3c9bd55 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 16:31:08 +0700 Subject: [PATCH 08/15] update uf2 index url, add UF2_ prefix for volume lable and index url --- README.md | 4 ++-- src/boards/electronut_labs_papyr/board.h | 4 ++-- src/boards/feather_nrf52832/board.h | 1 + src/boards/feather_nrf52840_express/board.h | 11 ++++++----- src/boards/mdk_nrf52840_dongle/board.h | 14 ++++++-------- src/boards/metro_nrf52840_express/board.h | 12 +++++++----- src/boards/particle_argon/board.h | 12 +++++------- src/boards/particle_boron/board.h | 12 +++++------- src/boards/particle_xenon/board.h | 12 +++++------- src/boards/pca10056/board.h | 3 ++- src/boards/pca10059/board.h | 3 ++- src/usb/uf2/ghostfat.c | 4 ++-- src/usb/uf2/uf2cfg.h | 8 ++------ 13 files changed, 47 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 967c2df..44662ce 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ This is a CDC/DFU/UF2 bootloader for nRF52 boards. - [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) - [Electronut Labs Papyr](https://docs.electronut.in/papyr/) - MakerDiary MDK nRF52840 USB Dongle -- Nordic nRF52840DK PCA10056 -- Nordic nRF52840DK PCA10059 ("Dongle") +- [Nordic nRF52840DK PCA10056](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK) +- [Nordic nRF52840DK PCA10059 ("Dongle")](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle) - Particle Argon - Particle Boron - Particle Xenon diff --git a/src/boards/electronut_labs_papyr/board.h b/src/boards/electronut_labs_papyr/board.h index 0dc1a5e..6faa675 100644 --- a/src/boards/electronut_labs_papyr/board.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -60,8 +60,8 @@ #define DIS_MANUFACTURER "Electronut Labs" #define DIS_MODEL "Papyr" -#define UF2_BOARD_ID "Electronut Labs Papyr" -#define INDEX_URL "https://docs.electronut.in/papyr" +#define UF2_BOARD_ID "Electronut Labs Papyr" +#define UF2_INDEX_URL "https://docs.electronut.in/papyr" #define USB_DESC_VID 0x239A #define USB_DESC_UF2_PID 0x003B diff --git a/src/boards/feather_nrf52832/board.h b/src/boards/feather_nrf52832/board.h index ee70cdc..1d048dd 100644 --- a/src/boards/feather_nrf52832/board.h +++ b/src/boards/feather_nrf52832/board.h @@ -55,5 +55,6 @@ #define DIS_MODEL "Bluefruit Feather nRF52832" #define PRODUCT_NAME "Adafruit Bluefruit Feather nRF52832" +#define UF2_INDEX_URL "https://www.adafruit.com/product/3406" #endif // _FEATHER_NRF52832_H diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 7f16a32..33a6508 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -55,11 +55,12 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Adafruit Industries" -#define DIS_MODEL "Bluefruit Feather nRF52840 Express" +#define DIS_MANUFACTURER "Adafruit Industries" +#define DIS_MODEL "Bluefruit Feather nRF52840 Express" -#define PRODUCT_NAME "Adafruit Feather nRF52840 Express" -#define VOLUME_LABEL "FTHR840BOOT" -#define UF2_BOARD_ID "nRF52840-Feather-revD" +#define PRODUCT_NAME "Adafruit Feather nRF52840 Express" +#define UF2_VOLUME_LABEL "FTHR840BOOT" +#define UF2_BOARD_ID "nRF52840-Feather-revD" +#define UF2_INDEX_URL "https://www.adafruit.com/product/4062" #endif // _FEATHER_NRF52840_H diff --git a/src/boards/mdk_nrf52840_dongle/board.h b/src/boards/mdk_nrf52840_dongle/board.h index e35d31f..d49006e 100644 --- a/src/boards/mdk_nrf52840_dongle/board.h +++ b/src/boards/mdk_nrf52840_dongle/board.h @@ -49,14 +49,12 @@ #define BUTTON_PULL NRF_GPIO_PIN_PULLUP // Used as model string in OTA mode -#define DIS_MANUFACTURER "MakerDiary" -#define DIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" +#define DIS_MANUFACTURER "MakerDiary" +#define DIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" -#define PRODUCT_NAME "MDK nRF52840 USB Dongle" -#define VOLUME_LABEL "MDK840DONGL" - -#define UF2_BOARD_ID "MakerDiary-nRF52840-USB-Dongle" - -#define INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" +#define PRODUCT_NAME "MDK nRF52840 USB Dongle" +#define UF2_VOLUME_LABEL "MDK840DONGL" +#define UF2_BOARD_ID "MakerDiary-nRF52840-USB-Dongle" +#define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" #endif /* _MDK_NRF52840_DONGLE_H_ */ diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index 033ab1c..c3d0059 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -55,12 +55,14 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Adafruit Industries" -#define DIS_MODEL "Bluefruit Metro nRF52840 Express" +#define DIS_MANUFACTURER "Adafruit Industries" +#define DIS_MODEL "Bluefruit Metro nRF52840 Express" -#define PRODUCT_NAME "Adafruit Metro nRF52840 Express" -#define VOLUME_LABEL "METR840BOOT" -#define UF2_BOARD_ID "nRF52840-Metro-revA" +#define PRODUCT_NAME "Adafruit Metro nRF52840 Express" +#define UF2_VOLUME_LABEL "METR840BOOT" +#define UF2_BOARD_ID "nRF52840-Metro-revA" + +#define UF2_INDEX_URL "https://www.adafruit.com/" #endif /* _METRO_NRF52840_H_ */ diff --git a/src/boards/particle_argon/board.h b/src/boards/particle_argon/board.h index 3e0a9f7..638c5e7 100644 --- a/src/boards/particle_argon/board.h +++ b/src/boards/particle_argon/board.h @@ -57,13 +57,11 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Argon" +#define DIS_MANUFACTURER "Particle Industries" +#define DIS_MODEL "Argon" -#define VOLUME_LABEL "ARGONBOOT " - -#define UF2_BOARD_ID "nRF52840-Argon-v1" - -#define INDEX_URL "https://www.particle.io/mesh/" +#define UF2_VOLUME_LABEL "ARGONBOOT " +#define UF2_BOARD_ID "nRF52840-Argon-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" #endif // _PARTICLE_ARGON_H diff --git a/src/boards/particle_boron/board.h b/src/boards/particle_boron/board.h index 6209136..aa92257 100644 --- a/src/boards/particle_boron/board.h +++ b/src/boards/particle_boron/board.h @@ -57,13 +57,11 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Boron" +#define DIS_MANUFACTURER "Particle Industries" +#define DIS_MODEL "Boron" -#define VOLUME_LABEL "BORONBOOT " - -#define UF2_BOARD_ID "nRF52840-Boron-v1" - -#define INDEX_URL "https://www.particle.io/mesh/" +#define UF2_VOLUME_LABEL "BORONBOOT " +#define UF2_BOARD_ID "nRF52840-Boron-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" #endif // _PARTICLE_BORON_H diff --git a/src/boards/particle_xenon/board.h b/src/boards/particle_xenon/board.h index 6b9cbf0..460322f 100644 --- a/src/boards/particle_xenon/board.h +++ b/src/boards/particle_xenon/board.h @@ -57,13 +57,11 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Xenon" +#define DIS_MANUFACTURER "Particle Industries" +#define DIS_MODEL "Xenon" -#define VOLUME_LABEL "XENONBOOT " - -#define UF2_BOARD_ID "nRF52840-Xenon-v1" - -#define INDEX_URL "https://www.particle.io/mesh/" +#define UF2_VOLUME_LABEL "XENONBOOT " +#define UF2_BOARD_ID "nRF52840-Xenon-v1" +#define UF2_INDEX_URL "https://www.particle.io/mesh/" #endif // _PARTICLE_XENON_H diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h index 1c0aa7b..b4d20b2 100644 --- a/src/boards/pca10056/board.h +++ b/src/boards/pca10056/board.h @@ -54,6 +54,7 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10056" -#define UF2_BOARD_ID "nRF52840-pca10056-v1" +#define UF2_BOARD_ID "nRF52840-pca10056-v1" +#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK" #endif // PCA10056_H diff --git a/src/boards/pca10059/board.h b/src/boards/pca10059/board.h index a2d76d8..0ca9c45 100644 --- a/src/boards/pca10059/board.h +++ b/src/boards/pca10059/board.h @@ -57,6 +57,7 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10059" -#define UF2_BOARD_ID "nRF52840-pca10059-v1" +#define UF2_BOARD_ID "nRF52840-pca10059-v1" +#define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle" #endif // PCA10059_H diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index bf39999..7bda507 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -71,7 +71,7 @@ const char indexFile[] = // "" "" "" "" "\n"; @@ -131,7 +131,7 @@ static FAT_BootBlock const BootBlock = { .PhysicalDriveNum = 0x80, // to match MediaDescriptor of 0xF8 .ExtendedBootSig = 0x29, .VolumeSerialNumber = 0x00420042, - .VolumeLabel = VOLUME_LABEL, + .VolumeLabel = UF2_VOLUME_LABEL, .FilesystemIdentifier = "FAT16 ", }; diff --git a/src/usb/uf2/uf2cfg.h b/src/usb/uf2/uf2cfg.h index 6042b67..dec5f79 100644 --- a/src/usb/uf2/uf2cfg.h +++ b/src/usb/uf2/uf2cfg.h @@ -4,16 +4,12 @@ #define PRODUCT_NAME DIS_MODEL #endif -#ifndef INDEX_URL -#define INDEX_URL "https://www.adafruit.com/" -#endif - #define BOOTLOADER_ID MK_DIS_FIRMWARE #define UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16 -#ifndef VOLUME_LABEL -#define VOLUME_LABEL "NRF52BOOT " +#ifndef UF2_VOLUME_LABEL +#define UF2_VOLUME_LABEL "NRF52BOOT " #endif #define FLASH_SIZE (USER_FLASH_END-USER_FLASH_START) // Max flash size From 6bbcab7f50818185a59576252ca3daf27e5cf40a Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 16:46:25 +0700 Subject: [PATCH 09/15] update uf2 product name --- src/boards/electronut_labs_papyr/board.h | 3 ++- src/boards/feather_nrf52832/board.h | 2 +- src/boards/feather_nrf52840_express/board.h | 2 +- src/boards/mdk_nrf52840_dongle/board.h | 2 +- src/boards/metro_nrf52840_express/board.h | 2 +- src/boards/particle_argon/board.h | 1 + src/boards/particle_boron/board.h | 1 + src/boards/particle_xenon/board.h | 1 + src/boards/pca10056/board.h | 1 + src/boards/pca10059/board.h | 3 ++- src/usb/uf2/ghostfat.c | 2 +- src/usb/uf2/uf2cfg.h | 8 +------- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/boards/electronut_labs_papyr/board.h b/src/boards/electronut_labs_papyr/board.h index 6faa675..2f9289a 100644 --- a/src/boards/electronut_labs_papyr/board.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -60,7 +60,8 @@ #define DIS_MANUFACTURER "Electronut Labs" #define DIS_MODEL "Papyr" -#define UF2_BOARD_ID "Electronut Labs Papyr" +#define UF2_PRODUCT_NAME "Electronut Labs Papyr" +#define UF2_BOARD_ID "nRF52840-Papyr-v1" #define UF2_INDEX_URL "https://docs.electronut.in/papyr" #define USB_DESC_VID 0x239A diff --git a/src/boards/feather_nrf52832/board.h b/src/boards/feather_nrf52832/board.h index 1d048dd..d8ac9db 100644 --- a/src/boards/feather_nrf52832/board.h +++ b/src/boards/feather_nrf52832/board.h @@ -54,7 +54,7 @@ #define DIS_MANUFACTURER "Adafruit Industries" #define DIS_MODEL "Bluefruit Feather nRF52832" -#define PRODUCT_NAME "Adafruit Bluefruit Feather nRF52832" +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52832" #define UF2_INDEX_URL "https://www.adafruit.com/product/3406" #endif // _FEATHER_NRF52832_H diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 33a6508..3ea204b 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -58,7 +58,7 @@ #define DIS_MANUFACTURER "Adafruit Industries" #define DIS_MODEL "Bluefruit Feather nRF52840 Express" -#define PRODUCT_NAME "Adafruit Feather nRF52840 Express" +#define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" #define UF2_VOLUME_LABEL "FTHR840BOOT" #define UF2_BOARD_ID "nRF52840-Feather-revD" #define UF2_INDEX_URL "https://www.adafruit.com/product/4062" diff --git a/src/boards/mdk_nrf52840_dongle/board.h b/src/boards/mdk_nrf52840_dongle/board.h index d49006e..6d906be 100644 --- a/src/boards/mdk_nrf52840_dongle/board.h +++ b/src/boards/mdk_nrf52840_dongle/board.h @@ -52,7 +52,7 @@ #define DIS_MANUFACTURER "MakerDiary" #define DIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" -#define PRODUCT_NAME "MDK nRF52840 USB Dongle" +#define UF2_PRODUCT_NAME "MDK nRF52840 USB Dongle" #define UF2_VOLUME_LABEL "MDK840DONGL" #define UF2_BOARD_ID "MakerDiary-nRF52840-USB-Dongle" #define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index c3d0059..7ff4344 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -58,7 +58,7 @@ #define DIS_MANUFACTURER "Adafruit Industries" #define DIS_MODEL "Bluefruit Metro nRF52840 Express" -#define PRODUCT_NAME "Adafruit Metro nRF52840 Express" +#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" #define UF2_VOLUME_LABEL "METR840BOOT" #define UF2_BOARD_ID "nRF52840-Metro-revA" diff --git a/src/boards/particle_argon/board.h b/src/boards/particle_argon/board.h index 638c5e7..4f83b30 100644 --- a/src/boards/particle_argon/board.h +++ b/src/boards/particle_argon/board.h @@ -60,6 +60,7 @@ #define DIS_MANUFACTURER "Particle Industries" #define DIS_MODEL "Argon" +#define UF2_PRODUCT_NAME "Particle Argon" #define UF2_VOLUME_LABEL "ARGONBOOT " #define UF2_BOARD_ID "nRF52840-Argon-v1" #define UF2_INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/particle_boron/board.h b/src/boards/particle_boron/board.h index aa92257..76787e3 100644 --- a/src/boards/particle_boron/board.h +++ b/src/boards/particle_boron/board.h @@ -60,6 +60,7 @@ #define DIS_MANUFACTURER "Particle Industries" #define DIS_MODEL "Boron" +#define UF2_PRODUCT_NAME "Particle Boron" #define UF2_VOLUME_LABEL "BORONBOOT " #define UF2_BOARD_ID "nRF52840-Boron-v1" #define UF2_INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/particle_xenon/board.h b/src/boards/particle_xenon/board.h index 460322f..96e1dd4 100644 --- a/src/boards/particle_xenon/board.h +++ b/src/boards/particle_xenon/board.h @@ -60,6 +60,7 @@ #define DIS_MANUFACTURER "Particle Industries" #define DIS_MODEL "Xenon" +#define UF2_PRODUCT_NAME "Particle Xenon" #define UF2_VOLUME_LABEL "XENONBOOT " #define UF2_BOARD_ID "nRF52840-Xenon-v1" #define UF2_INDEX_URL "https://www.particle.io/mesh/" diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h index b4d20b2..e9be765 100644 --- a/src/boards/pca10056/board.h +++ b/src/boards/pca10056/board.h @@ -54,6 +54,7 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10056" +#define UF2_PRODUCT_NAME "Nordic nRF52840 DK" #define UF2_BOARD_ID "nRF52840-pca10056-v1" #define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK" diff --git a/src/boards/pca10059/board.h b/src/boards/pca10059/board.h index 0ca9c45..b64c360 100644 --- a/src/boards/pca10059/board.h +++ b/src/boards/pca10059/board.h @@ -38,7 +38,7 @@ /*------------------------------------------------------------------*/ /* BUTTON *------------------------------------------------------------------*/ -#define BUTTONS_NUMBER 2 +#define BUTTONS_NUMBER 2 #define BUTTON_1 _PINNUM(1, 6) #define BUTTON_2 _PINNUM(1, 10) @@ -57,6 +57,7 @@ #define DIS_MANUFACTURER "Nordic" #define DIS_MODEL "PCA10059" +#define UF2_PRODUCT_NAME "Nordic nRF52840 Dongle" #define UF2_BOARD_ID "nRF52840-pca10059-v1" #define UF2_INDEX_URL "https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-Dongle" diff --git a/src/usb/uf2/ghostfat.c b/src/usb/uf2/ghostfat.c index 7bda507..6f13980 100644 --- a/src/usb/uf2/ghostfat.c +++ b/src/usb/uf2/ghostfat.c @@ -62,7 +62,7 @@ struct TextFile { const char infoUf2File[] = // "UF2 Bootloader " UF2_VERSION "\r\n" - "Model: " PRODUCT_NAME "\r\n" + "Model: " UF2_PRODUCT_NAME "\r\n" "Board-ID: " UF2_BOARD_ID "\r\n" "Date: " __DATE__ "\r\n"; diff --git a/src/usb/uf2/uf2cfg.h b/src/usb/uf2/uf2cfg.h index dec5f79..a100f44 100644 --- a/src/usb/uf2/uf2cfg.h +++ b/src/usb/uf2/uf2cfg.h @@ -1,15 +1,9 @@ #include "boards.h" -#ifndef PRODUCT_NAME - #define PRODUCT_NAME DIS_MODEL -#endif - -#define BOOTLOADER_ID MK_DIS_FIRMWARE - #define UF2_NUM_BLOCKS 8000 // at least 4,1 MB for FAT16 #ifndef UF2_VOLUME_LABEL -#define UF2_VOLUME_LABEL "NRF52BOOT " +#define UF2_VOLUME_LABEL "NRF52BOOT " #endif #define FLASH_SIZE (USER_FLASH_END-USER_FLASH_START) // Max flash size From b3b9e089f49ad7d68b3999512c1c89210c541c45 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 16:51:31 +0700 Subject: [PATCH 10/15] clean up --- .../components/libraries/bootloader_dfu/dfu_transport_ble.c | 4 ++-- src/boards/electronut_labs_papyr/board.h | 6 +++--- src/boards/feather_nrf52832/board.h | 4 ++-- src/boards/feather_nrf52840_express/board.h | 4 ++-- src/boards/mdk_nrf52840_dongle/board.h | 6 +++--- src/boards/metro_nrf52840_express/board.h | 4 ++-- src/boards/particle_argon/board.h | 4 ++-- src/boards/particle_boron/board.h | 4 ++-- src/boards/particle_xenon/board.h | 4 ++-- src/boards/pca10056/board.h | 4 ++-- src/boards/pca10059/board.h | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c index 6fb0787..104bb45 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c @@ -994,8 +994,8 @@ static void services_init(void) ble_dis_init_t dis_init; memset(&dis_init, 0, sizeof(dis_init)); - ascii_to_utf8(&dis_init.manufact_name_str, DIS_MANUFACTURER); - ascii_to_utf8(&dis_init.model_num_str, DIS_MODEL); + ascii_to_utf8(&dis_init.manufact_name_str, BLEDIS_MANUFACTURER); + ascii_to_utf8(&dis_init.model_num_str, BLEDIS_MODEL); uint32_t const sd_id = SD_ID_GET(MBR_SIZE); uint32_t const sd_version = SD_VERSION_GET(MBR_SIZE); diff --git a/src/boards/electronut_labs_papyr/board.h b/src/boards/electronut_labs_papyr/board.h index 2f9289a..bc398ea 100644 --- a/src/boards/electronut_labs_papyr/board.h +++ b/src/boards/electronut_labs_papyr/board.h @@ -57,10 +57,10 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Electronut Labs" -#define DIS_MODEL "Papyr" +#define BLEDIS_MANUFACTURER "Electronut Labs" +#define BLEDIS_MODEL "Papyr" -#define UF2_PRODUCT_NAME "Electronut Labs Papyr" +#define UF2_PRODUCT_NAME "Electronut Labs Papyr" #define UF2_BOARD_ID "nRF52840-Papyr-v1" #define UF2_INDEX_URL "https://docs.electronut.in/papyr" diff --git a/src/boards/feather_nrf52832/board.h b/src/boards/feather_nrf52832/board.h index d8ac9db..9acec40 100644 --- a/src/boards/feather_nrf52832/board.h +++ b/src/boards/feather_nrf52832/board.h @@ -51,8 +51,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Adafruit Industries" -#define DIS_MODEL "Bluefruit Feather nRF52832" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52832" #define UF2_PRODUCT_NAME "Adafruit Feather nRF52832" #define UF2_INDEX_URL "https://www.adafruit.com/product/3406" diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 3ea204b..090ef50 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -55,8 +55,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Adafruit Industries" -#define DIS_MODEL "Bluefruit Feather nRF52840 Express" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Feather nRF52840 Express" #define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" #define UF2_VOLUME_LABEL "FTHR840BOOT" diff --git a/src/boards/mdk_nrf52840_dongle/board.h b/src/boards/mdk_nrf52840_dongle/board.h index 6d906be..3f3c6a3 100644 --- a/src/boards/mdk_nrf52840_dongle/board.h +++ b/src/boards/mdk_nrf52840_dongle/board.h @@ -49,12 +49,12 @@ #define BUTTON_PULL NRF_GPIO_PIN_PULLUP // Used as model string in OTA mode -#define DIS_MANUFACTURER "MakerDiary" -#define DIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" +#define BLEDIS_MANUFACTURER "MakerDiary" +#define BLEDIS_MODEL "nRF52840 Micro Dev Kit USB Dongle" #define UF2_PRODUCT_NAME "MDK nRF52840 USB Dongle" #define UF2_VOLUME_LABEL "MDK840DONGL" -#define UF2_BOARD_ID "MakerDiary-nRF52840-USB-Dongle" +#define UF2_BOARD_ID "nRF52840-Dongle-v1" #define UF2_INDEX_URL "https://wiki.makerdiary.com/nrf52840-mdk-usb-dongle/" #endif /* _MDK_NRF52840_DONGLE_H_ */ diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index 7ff4344..786b8d6 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -55,8 +55,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Adafruit Industries" -#define DIS_MODEL "Bluefruit Metro nRF52840 Express" +#define BLEDIS_MANUFACTURER "Adafruit Industries" +#define BLEDIS_MODEL "Metro nRF52840 Express" #define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" #define UF2_VOLUME_LABEL "METR840BOOT" diff --git a/src/boards/particle_argon/board.h b/src/boards/particle_argon/board.h index 4f83b30..a644e82 100644 --- a/src/boards/particle_argon/board.h +++ b/src/boards/particle_argon/board.h @@ -57,8 +57,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Argon" +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Argon" #define UF2_PRODUCT_NAME "Particle Argon" #define UF2_VOLUME_LABEL "ARGONBOOT " diff --git a/src/boards/particle_boron/board.h b/src/boards/particle_boron/board.h index 76787e3..62c1713 100644 --- a/src/boards/particle_boron/board.h +++ b/src/boards/particle_boron/board.h @@ -57,8 +57,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Boron" +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Boron" #define UF2_PRODUCT_NAME "Particle Boron" #define UF2_VOLUME_LABEL "BORONBOOT " diff --git a/src/boards/particle_xenon/board.h b/src/boards/particle_xenon/board.h index 96e1dd4..d00b6a4 100644 --- a/src/boards/particle_xenon/board.h +++ b/src/boards/particle_xenon/board.h @@ -57,8 +57,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Particle Industries" -#define DIS_MODEL "Xenon" +#define BLEDIS_MANUFACTURER "Particle Industries" +#define BLEDIS_MODEL "Xenon" #define UF2_PRODUCT_NAME "Particle Xenon" #define UF2_VOLUME_LABEL "XENONBOOT " diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h index e9be765..089aa2e 100644 --- a/src/boards/pca10056/board.h +++ b/src/boards/pca10056/board.h @@ -51,8 +51,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Nordic" -#define DIS_MODEL "PCA10056" +#define BLEDIS_MANUFACTURER "Nordic" +#define BLEDIS_MODEL "PCA10056" #define UF2_PRODUCT_NAME "Nordic nRF52840 DK" #define UF2_BOARD_ID "nRF52840-pca10056-v1" diff --git a/src/boards/pca10059/board.h b/src/boards/pca10059/board.h index b64c360..8c7a5c7 100644 --- a/src/boards/pca10059/board.h +++ b/src/boards/pca10059/board.h @@ -54,8 +54,8 @@ #define HWFC false // Used as model string in OTA mode -#define DIS_MANUFACTURER "Nordic" -#define DIS_MODEL "PCA10059" +#define BLEDIS_MANUFACTURER "Nordic" +#define BLEDIS_MODEL "PCA10059" #define UF2_PRODUCT_NAME "Nordic nRF52840 Dongle" #define UF2_BOARD_ID "nRF52840-pca10059-v1" From 5eac387b5a00d4bd6cf4f9d3ae2fef11361d0d30 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 17:13:41 +0700 Subject: [PATCH 11/15] clean up BLEDIS firmware version --- Makefile | 6 +----- .../libraries/bootloader_dfu/dfu_transport_ble.c | 13 +------------ src/segger/Adafruit_nRF52_Bootloader.emProject | 11 +++++++---- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 683be6b..e795d8c 100644 --- a/Makefile +++ b/Makefile @@ -29,9 +29,6 @@ LD_FILE = $(SRC_PATH)/linker/$(SD_NAME)_v$(SD_VER1).ld MERGED_FNAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION) - -MK_DIS_FIRMWARE = "$(SD_NAME) $(SD_VERSION)" - GIT_VERSION = $(shell git describe --dirty --always --tags) GIT_SUBMODULE_VERSIONS = $(shell git submodule status | cut -d' ' -f3,4 | paste -s -d" " -) @@ -225,7 +222,6 @@ IPATH += $(SDK_PATH)/drivers_nrf/delay IPATH += $(SD_API_PATH)/include IPATH += $(SD_API_PATH)/include/nrf52 - INC_PATHS = $(addprefix -I,$(IPATH)) #****************************************************************************** @@ -255,10 +251,10 @@ CFLAGS += -DBLE_STACK_SUPPORT_REQD CFLAGS += -DSWI_DISABLE0 CFLAGS += -DSOFTDEVICE_PRESENT CFLAGS += -DFLOAT_ABI_HARD -CFLAGS += -DMK_DIS_FIRMWARE='$(MK_DIS_FIRMWARE)' CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096 CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"' +CFLAGS += -DBLEDIS_FW_VERSION='"$(GIT_VERSION) $(SD_NAME) $(SD_VERSION)"' ifneq ($(IS_52832),) CFLAGS += -DNRF52 diff --git a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c index 104bb45..89c2096 100644 --- a/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c +++ b/lib/sdk11/components/libraries/bootloader_dfu/dfu_transport_ble.c @@ -996,18 +996,7 @@ static void services_init(void) ascii_to_utf8(&dis_init.manufact_name_str, BLEDIS_MANUFACTURER); ascii_to_utf8(&dis_init.model_num_str, BLEDIS_MODEL); - - uint32_t const sd_id = SD_ID_GET(MBR_SIZE); - uint32_t const sd_version = SD_VERSION_GET(MBR_SIZE); - - uint32_t const ver1 = sd_version / 1000000; - uint32_t const ver2 = (sd_version % 1000000)/1000; - uint32_t const ver3 = sd_version % 1000; - - char fw_str[30+1]; - sprintf(fw_str, "s%ld %ld.%ld.%ld r%ld", sd_id, ver1, ver2, ver3, MK_BOOTLOADER_VERSION & 0xFFUL); - - ascii_to_utf8(&dis_init.fw_rev_str, fw_str); + ascii_to_utf8(&dis_init.fw_rev_str, BLEDIS_FW_VERSION); BLE_GAP_CONN_SEC_MODE_SET_OPEN(&dis_init.dis_attr_md.read_perm); BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&dis_init.dis_attr_md.write_perm); diff --git a/src/segger/Adafruit_nRF52_Bootloader.emProject b/src/segger/Adafruit_nRF52_Bootloader.emProject index cc72c5b..a7c2862 100644 --- a/src/segger/Adafruit_nRF52_Bootloader.emProject +++ b/src/segger/Adafruit_nRF52_Bootloader.emProject @@ -19,7 +19,7 @@ arm_target_device_name="nRF52840_xxAA" arm_target_interface_type="SWD" build_treat_warnings_as_errors="Yes" - c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x06010000;CONFIG_GPIO_AS_PINRESET;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger"" + c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x06010000;CONFIG_GPIO_AS_PINRESET;CONFIG_NFCT_PINS_AS_GPIOS;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger";BLEDIS_FW_VERSION="Segger"" c_user_include_directories="../;../usb;../boards;../cmsis/include;$(tusbDir);$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(sdDir)/include;$(sdDir)/include/nrf52;$(sdk11Dir)/drivers_nrf/pstorage;$(sdk11Dir)/ble/common/;$(sdk11Dir)/ble/ble_services/ble_dfu;$(sdk11Dir)/ble/ble_services/ble_dis;$(sdk11Dir)/libraries/bootloader_dfu;$(sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(sdk11Dir)/libraries/util;$(sdkDir)/toolchain/cmsis/include;$(sdkDir)/device;$(sdkDir)/toolchain;$(sdkDir)/drivers_nrf/hal;$(sdkDir)/drivers_nrf/systick;$(sdkDir)/drivers_nrf/uart;$(sdkDir)/drivers_nrf/usbd;$(sdkDir)/drivers_nrf/common;$(sdkDir)/drivers_nrf/delay;$(sdkDir)/drivers_nrf/power;$(sdkDir)/drivers_nrf/clock;$(sdkDir)/libraries/util;$(sdkDir)/libraries/timer;$(sdkDir)/libraries/scheduler;$(sdkDir)/libraries/crc16;$(sdkDir)/libraries/util;$(sdkDir)/libraries/hci/config;$(sdkDir)/libraries/uart;$(sdkDir)/libraries/hci;$(sdkDir)/external/fprintf;$(sdkDir)/libraries/strerror;$(sdkDir)/libraries/atomic;$(sdkDir)/libraries/balloc;$(sdkDir)/libraries/experimental_log/src;$(sdkDir)/libraries/experimental_log;$(sdkDir)/libraries/experimental_section_vars;$(sdkDir)/libraries/experimental_memobj" debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml" debug_target_connection="J-Link" @@ -375,17 +375,20 @@ From 01f854c3db6afed6f49a7357585abaa40bbb1ea8 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 18:25:25 +0700 Subject: [PATCH 12/15] correct MK_BOOTLOADER_VERSION to same as git tag version --- Makefile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index e795d8c..0adf668 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ #****************************************************************************** # CONFIGURE -# - SDK_PATH : path to SDK directory -# - SRC_PATH : path to src folder +# - SDK_PATH : path to SDK directory +# - SRC_PATH : path to src folder # -# - SD_NAME : e.g s132, s140 -# - SD_VER1, SD_VER2, SD_VER3: SoftDevice version e.g 6.0.0 -# - SD_HEX : to bootloader hex binary +# - SD_NAME : e.g s132, s140 +# - SD_VERSSION : SoftDevice version e.g 6.0.0 +# - SD_HEX : to bootloader hex binary #****************************************************************************** SRC_PATH = src @@ -16,16 +16,12 @@ SD_PATH = lib/softdevice/$(SD_FILENAME) TUSB_PATH = lib/tinyusb/src NRFX_PATH = lib/nrfx -SD_VER1 = 6 -SD_VER2 = 1 -SD_VER3 = 1 - -SD_VERSION = $(SD_VER1).$(SD_VER2).$(SD_VER3) +SD_VERSION = 6.1.1 SD_FILENAME = $(SD_NAME)_nrf52_$(SD_VERSION) SD_API_PATH = $(SD_PATH)/$(SD_FILENAME)_API SD_HEX = $(SD_PATH)/$(SD_FILENAME)_softdevice.hex -LD_FILE = $(SRC_PATH)/linker/$(SD_NAME)_v$(SD_VER1).ld +LD_FILE = $(SRC_PATH)/linker/$(SD_NAME)_v$(word 1, $(subst ., ,$(SD_VERSION))).ld MERGED_FNAME = $(OUTPUT_FILENAME)_$(SD_NAME)_$(SD_VERSION) @@ -33,6 +29,7 @@ GIT_VERSION = $(shell git describe --dirty --always --tags) GIT_SUBMODULE_VERSIONS = $(shell git submodule status | cut -d' ' -f3,4 | paste -s -d" " -) OUTPUT_FILENAME = $(BOARD)_bootloader-$(GIT_VERSION) + #****************************************************************************** # Tool configure #****************************************************************************** @@ -240,10 +237,6 @@ CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing CFLAGS += -fno-builtin --short-enums -fstack-usage # Defined Symbol (MACROS) - -# TODO use GIT_VERSION (numberic format) -CFLAGS += -DMK_BOOTLOADER_VERSION=0x0$(SD_VER1)0$(SD_VER2)0$(SD_VER3)UL - CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -DCONFIG_GPIO_AS_PINRESET CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS @@ -256,6 +249,9 @@ CFLAGS += -DDFU_APP_DATA_RESERVED=7*4096 CFLAGS += -DUF2_VERSION='"$(GIT_VERSION) $(GIT_SUBMODULE_VERSIONS) $(SD_NAME) $(SD_VERSION)"' CFLAGS += -DBLEDIS_FW_VERSION='"$(GIT_VERSION) $(SD_NAME) $(SD_VERSION)"' +_VER = $(subst ., ,$(word 1, $(subst -, ,$(GIT_VERSION)))) +CFLAGS += -DMK_BOOTLOADER_VERSION='($(word 1,$(_VER)) << 16) + ($(word 2,$(_VER)) << 8) + $(word 3,$(_VER))' + ifneq ($(IS_52832),) CFLAGS += -DNRF52 CFLAGS += -DNRF52832_XXAA From 8f00fb92707a629c621abdb614379df6daffed2e Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 24 Apr 2019 18:31:26 +0700 Subject: [PATCH 13/15] update ses project --- src/segger/Adafruit_nRF52_Bootloader.emProject | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/segger/Adafruit_nRF52_Bootloader.emProject b/src/segger/Adafruit_nRF52_Bootloader.emProject index a7c2862..204a77e 100644 --- a/src/segger/Adafruit_nRF52_Bootloader.emProject +++ b/src/segger/Adafruit_nRF52_Bootloader.emProject @@ -19,7 +19,7 @@ arm_target_device_name="nRF52840_xxAA" arm_target_interface_type="SWD" build_treat_warnings_as_errors="Yes" - c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x06010000;CONFIG_GPIO_AS_PINRESET;CONFIG_NFCT_PINS_AS_GPIOS;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger";BLEDIS_FW_VERSION="Segger"" + c_preprocessor_definitions="__nRF_FAMILY;ARM_MATH_CM4;FLASH_PLACEMENT=1;NO_VTOR_CONFIG;MK_BOOTLOADER_VERSION=0x00020A;CONFIG_GPIO_AS_PINRESET;CONFIG_NFCT_PINS_AS_GPIOS;BLE_STACK_SUPPORT_REQD;SWI_DISABLE0;SOFTDEVICE_PRESENT;FLOAT_ABI_HARD;CFG_TUSB_DEBUG=2;UF2_VERSION="Segger";BLEDIS_FW_VERSION="Segger"" c_user_include_directories="../;../usb;../boards;../cmsis/include;$(tusbDir);$(nrfxDir);$(nrfxDir)/mdk;$(nrfxDir)/hal;$(nrfxDir)/drivers/include;$(sdDir)/include;$(sdDir)/include/nrf52;$(sdk11Dir)/drivers_nrf/pstorage;$(sdk11Dir)/ble/common/;$(sdk11Dir)/ble/ble_services/ble_dfu;$(sdk11Dir)/ble/ble_services/ble_dis;$(sdk11Dir)/libraries/bootloader_dfu;$(sdk11Dir)/libraries/bootloader_dfu/hci_transport;$(sdk11Dir)/libraries/util;$(sdkDir)/toolchain/cmsis/include;$(sdkDir)/device;$(sdkDir)/toolchain;$(sdkDir)/drivers_nrf/hal;$(sdkDir)/drivers_nrf/systick;$(sdkDir)/drivers_nrf/uart;$(sdkDir)/drivers_nrf/usbd;$(sdkDir)/drivers_nrf/common;$(sdkDir)/drivers_nrf/delay;$(sdkDir)/drivers_nrf/power;$(sdkDir)/drivers_nrf/clock;$(sdkDir)/libraries/util;$(sdkDir)/libraries/timer;$(sdkDir)/libraries/scheduler;$(sdkDir)/libraries/crc16;$(sdkDir)/libraries/util;$(sdkDir)/libraries/hci/config;$(sdkDir)/libraries/uart;$(sdkDir)/libraries/hci;$(sdkDir)/external/fprintf;$(sdkDir)/libraries/strerror;$(sdkDir)/libraries/atomic;$(sdkDir)/libraries/balloc;$(sdkDir)/libraries/experimental_log/src;$(sdkDir)/libraries/experimental_log;$(sdkDir)/libraries/experimental_section_vars;$(sdkDir)/libraries/experimental_memobj" debug_register_definition_file="$(ProjectDir)/nrf52840_Registers.xml" debug_target_connection="J-Link" From a7c19a4d99006b6b2af09191b6c8de135dc03c50 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 25 Apr 2019 10:36:08 +0700 Subject: [PATCH 14/15] fix typo per PR discussion --- Makefile | 2 +- README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0adf668..55082e4 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # - SRC_PATH : path to src folder # # - SD_NAME : e.g s132, s140 -# - SD_VERSSION : SoftDevice version e.g 6.0.0 +# - SD_VERSION : SoftDevice version e.g 6.0.0 # - SD_HEX : to bootloader hex binary #****************************************************************************** SRC_PATH = src diff --git a/README.md b/README.md index 44662ce..22b5b1a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This is a CDC/DFU/UF2 bootloader for nRF52 boards. - [Adafruit Feather nRF52832](https://www.adafruit.com/product/3406) - [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062) +- Adafruit Metro nRF52840 Express - [Electronut Labs Papyr](https://docs.electronut.in/papyr/) - MakerDiary MDK nRF52840 USB Dongle - [Nordic nRF52840DK PCA10056](https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52840-DK) From da2de8d519c07044f820b60249ceb7417e490e75 Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 27 Apr 2019 16:40:08 +0700 Subject: [PATCH 15/15] update pid for metro nrf52840 --- src/boards/feather_nrf52840_express/board.h | 8 ++++++++ src/boards/metro_nrf52840_express/board.h | 15 +++++++++++---- src/usb/usb.c | 2 +- src/usb/usb_desc.h | 8 ++++---- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/boards/feather_nrf52840_express/board.h b/src/boards/feather_nrf52840_express/board.h index 090ef50..9a256a2 100644 --- a/src/boards/feather_nrf52840_express/board.h +++ b/src/boards/feather_nrf52840_express/board.h @@ -58,6 +58,14 @@ #define BLEDIS_MANUFACTURER "Adafruit Industries" #define BLEDIS_MODEL "Feather nRF52840 Express" +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_CDC_ONLY_PID 0x002A + +//------------- UF2 -------------// #define UF2_PRODUCT_NAME "Adafruit Feather nRF52840 Express" #define UF2_VOLUME_LABEL "FTHR840BOOT" #define UF2_BOARD_ID "nRF52840-Feather-revD" diff --git a/src/boards/metro_nrf52840_express/board.h b/src/boards/metro_nrf52840_express/board.h index 786b8d6..0e68f01 100644 --- a/src/boards/metro_nrf52840_express/board.h +++ b/src/boards/metro_nrf52840_express/board.h @@ -58,11 +58,18 @@ #define BLEDIS_MANUFACTURER "Adafruit Industries" #define BLEDIS_MODEL "Metro nRF52840 Express" -#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" -#define UF2_VOLUME_LABEL "METR840BOOT" -#define UF2_BOARD_ID "nRF52840-Metro-revA" +//--------------------------------------------------------------------+ +// USB +//--------------------------------------------------------------------+ +#define USB_DESC_VID 0x239A +#define USB_DESC_UF2_PID 0x003F +#define USB_DESC_CDC_ONLY_PID 0x0040 -#define UF2_INDEX_URL "https://www.adafruit.com/" +//------------- UF2 -------------// +#define UF2_PRODUCT_NAME "Adafruit Metro nRF52840 Express" +#define UF2_VOLUME_LABEL "METR840BOOT" +#define UF2_BOARD_ID "nRF52840-Metro-revA" +#define UF2_INDEX_URL "https://www.adafruit.com/" #endif /* _METRO_NRF52840_H_ */ diff --git a/src/usb/usb.c b/src/usb/usb.c index 21df788..c9dbc30 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -97,7 +97,7 @@ void usb_init(bool cdc_only) if ( cdc_only ) { // Change PID to CDC only - usb_desc_dev.idProduct = USB_DESC_SERIAL_ONLY_PID; + usb_desc_dev.idProduct = USB_DESC_CDC_ONLY_PID; // Remove MSC interface = reduce total interface + adjust config desc length usb_desc_cfg.config.bNumInterfaces--; diff --git a/src/usb/usb_desc.h b/src/usb/usb_desc.h index 8b6dbc4..cb83263 100644 --- a/src/usb/usb_desc.h +++ b/src/usb/usb_desc.h @@ -33,15 +33,15 @@ #endif #ifndef USB_DESC_VID -#define USB_DESC_VID 0x239A +#define USB_DESC_VID 0x239A #endif #ifndef USB_DESC_UF2_PID -#define USB_DESC_UF2_PID 0x0029 +#define USB_DESC_UF2_PID 0x0029 #endif -#ifndef USB_DESC_SERIAL_ONLY_PID -#define USB_DESC_SERIAL_ONLY_PID 0x002A +#ifndef USB_DESC_CDC_ONLY_PID +#define USB_DESC_CDC_ONLY_PID 0x002A #endif