You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/24 21:21:01 UTC

[GitHub] [incubator-nuttx] antmerlino opened a new pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

antmerlino opened a new pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172


   ## Summary
   Adds bare bones support for Arduino Portenta H7
   
   ## Impact
   None.
   
   ## Testing
   Got a nsh console over USART1
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837484034



##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       @microhobby I do not see this is addressed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079604359


   @antmerlino Sorry for the delay, but other things have also changed. I put it in some reviews. I believe that it's all now (at least I had one successful build on my environment). Thanks for working on it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] antmerlino commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
antmerlino commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r836940178



##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,135 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/init.h>>

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-842334423


   @antmerlino CI fails looks like you need to rebase on master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-904621617


   @microhobby this offset 0x0804000 should depend of CONFIG_STM32H7_DFU please search for CONFIG_STM32_DFU for reference (it is defined at arch/arm/src/stm32/Kconfig)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r835899830



##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,135 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/init.h>>

Review comment:
       ```suggestion
   #include <nuttx/init.h>
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1081919805


   @antmerlino the files that are still not in the apache license format:
   
   https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/user-space.ld
   
   https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/memory.ld
   
   https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/scripts/kernel.space.ld
   
   https://github.com/antmerlino/incubator-nuttx/blob/arduino-portenta/boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r835755458



##########
File path: boards/arm/stm32h7/portenta-h7/include/board.h
##########
@@ -0,0 +1,368 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/include/board.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+#define __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Do not include STM32 H7 header files here */
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Clocking *****************************************************************/
+
+/* The board provides the following clock sources:
+ *
+ *  NOTE: The documentation and schematics claim that there is a 27MHz
+ *  oscillator for HSE. However, after much headache, it was measured
+ *  to actually be 25MHz. Looking at some mbed code validates that they
+ *  are using 25MHz as the HSE clock. This was further confirmed with the
+ *  Arduino staff.
+ *
+ *   U18: 25MHz HSE MEMS Oscillator
+ *   Y1:  32768Hz LSE crystal oscillator
+ *
+ * So we have these clock source available within the STM32
+ *
+ *   HSI: 64 MHz RC factory-trimmed
+ *   LSI: 32 KHz RC
+ *   HSE: 27 MHz oscillator
+ *   LSE: 32.768 kHz
+ */
+
+#define STM32_HSI_FREQUENCY     16000000ul
+#define STM32_LSI_FREQUENCY     32000
+#define STM32_HSE_FREQUENCY     25000000ul
+#define STM32_LSE_FREQUENCY     32768
+
+#define STM32_BOARD_USEHSE
+#define STM32_HSEBYP_ENABLE
+
+/* Main PLL Configuration.
+ *
+ * PLL source is HSE = 25,000,000
+ *
+ * When STM32_HSE_FREQUENCY / PLLM <= 2MHz VCOL must be selected.
+ * VCOH otherwise.
+ *
+ * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
+ * Subject to:
+ *
+ *     1 <= PLLM <= 63
+ *     4 <= PLLN <= 512
+ *   150 MHz <= PLL_VCOL <= 420MHz
+ *   192 MHz <= PLL_VCOH <= 836MHz
+ *
+ * SYSCLK  = PLL_VCO / PLLP
+ * CPUCLK  = SYSCLK / D1CPRE
+ * Subject to
+ *
+ *   PLLP1   = {2, 4, 6, 8, ..., 128}
+ *   PLLP2,3 = {2, 3, 4, ..., 128}
+ *   CPUCLK <= 480 MHz
+ */
+
+#define STM32_PLLCFG_PLLSRC      RCC_PLLCKSELR_PLLSRC_HSE
+
+/* PLL1, wide 2 - 4 MHz input, enable DIVP, DIVQ, DIVR
+ *
+ *   PLL1_VCO = (25,000,000 / 5) * 160 = 800 MHz
+ *
+ *   PLL1P = PLL1_VCO/2  = 960 MHz / 2   = 400 MHz
+ *   PLL1Q = PLL1_VCO/4  = 960 MHz / 4   = 200 MHz
+ *   PLL1R = PLL1_VCO/8  = 960 MHz / 8   = 100 MHz
+ */
+
+#define STM32_PLLCFG_PLL1CFG     (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
+                                  RCC_PLLCFGR_PLL1RGE_2_4_MHZ | \
+                                  RCC_PLLCFGR_DIVP1EN | \
+                                  RCC_PLLCFGR_DIVQ1EN | \
+                                  RCC_PLLCFGR_DIVR1EN)
+#define STM32_PLLCFG_PLL1M       RCC_PLLCKSELR_DIVM1(5)
+#define STM32_PLLCFG_PLL1N       RCC_PLL1DIVR_N1(160)
+#define STM32_PLLCFG_PLL1P       RCC_PLL1DIVR_P1(2)
+#define STM32_PLLCFG_PLL1Q       RCC_PLL1DIVR_Q1(4)
+#define STM32_PLLCFG_PLL1R       RCC_PLL1DIVR_R1(8)
+
+#define STM32_VCO1_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL1P_FREQUENCY    (STM32_VCO1_FREQUENCY / 2)
+#define STM32_PLL1Q_FREQUENCY    (STM32_VCO1_FREQUENCY / 4)
+#define STM32_PLL1R_FREQUENCY    (STM32_VCO1_FREQUENCY / 8)
+
+/* PLL2 */
+
+#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
+                              RCC_PLLCFGR_PLL2RGE_2_4_MHZ | \
+                              RCC_PLLCFGR_DIVP2EN)
+#define STM32_PLLCFG_PLL2M       RCC_PLLCKSELR_DIVM2(5)
+#define STM32_PLLCFG_PLL2N       RCC_PLL2DIVR_N2(160)
+#define STM32_PLLCFG_PLL2P       RCC_PLL2DIVR_P2(2)
+#define STM32_PLLCFG_PLL2Q       RCC_PLL2DIVR_Q2(4)
+#define STM32_PLLCFG_PLL2R       RCC_PLL2DIVR_R2(8)
+
+#define STM32_VCO2_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL2P_FREQUENCY    (STM32_VCO2_FREQUENCY / 2)
+#define STM32_PLL2Q_FREQUENCY    (STM32_VCO2_FREQUENCY / 4)
+#define STM32_PLL2R_FREQUENCY    (STM32_VCO2_FREQUENCY / 8)
+
+/* PLL3 */
+
+#define STM32_PLLCFG_PLL3CFG 0
+#define STM32_PLLCFG_PLL3M   0
+#define STM32_PLLCFG_PLL3N   0
+#define STM32_PLLCFG_PLL3P   0
+#define STM32_PLLCFG_PLL3Q   0
+#define STM32_PLLCFG_PLL3R   0
+
+#define STM32_VCO3_FREQUENCY
+#define STM32_PLL3P_FREQUENCY
+#define STM32_PLL3Q_FREQUENCY
+#define STM32_PLL3R_FREQUENCY

Review comment:
       Is it intentionally defined to empty?

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/mm/mm.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/userspace.h>
+
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+#ifndef CONFIG_NUTTX_USERSPACE
+#  error "CONFIG_NUTTX_USERSPACE not defined"
+#endif
+
+#if CONFIG_NUTTX_USERSPACE != 0x08020000
+#  error "CONFIG_NUTTX_USERSPACE must be 0x08020000 to match memory.ld"
+#endif
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* These 'addresses' of these values are setup by the linker script. They are
+ * not actual uint32_t storage locations! They are only used meaningfully in
+ * the following way:
+ *
+ *  - The linker script defines, for example, the symbol_sdata.
+ *  - The declaration extern uint32_t _sdata; makes C happy.  C will believe
+ *    that the value _sdata is the address of a uint32_t variable _data (it
+ *    is not!).
+ *  - We can recover the linker value then by simply taking the address of
+ *    of _data.  like:  uint32_t *pdata = &_sdata;
+ */
+
+extern uint32_t _stext;           /* Start of .text */
+extern uint32_t _etext;           /* End_1 of .text + .rodata */
+extern const uint32_t _eronly;    /* End+1 of read only section (.text + .rodata) */
+extern uint32_t _sdata;           /* Start of .data */
+extern uint32_t _edata;           /* End+1 of .data */
+extern uint32_t _sbss;            /* Start of .bss */
+extern uint32_t _ebss;            /* End+1 of .bss */
+
+/* This is the user space entry point */
+
+int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);
+
+const struct userspace_s userspace __attribute__ ((section (".userspace"))) =
+{
+  /* General memory map */
+
+  .us_entrypoint    = (main_t)CONFIG_USER_ENTRYPOINT,

Review comment:
       ```suggestion
     .us_entrypoint    = CONFIG_INIT_ENTRYPOINT,
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/portenta-h7.h
##########
@@ -0,0 +1,161 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/portenta-h7.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_STM32H747I_DISCO_SRC_STM32H747I_DISCO_H
+#define __BOARDS_ARM_STM32H7_STM32H747I_DISCO_SRC_STM32H747I_DISCO_H

Review comment:
       ```suggestion
   #ifndef __BOARDS_ARM_STM32H7_PORTENA_H7_SRC_PORTENA_H7_H
   #define __BOARDS_ARM_STM32H7_PORTENA_H7_SRC_PORTENA_H7_H
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/mm/mm.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/userspace.h>
+
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+#ifndef CONFIG_NUTTX_USERSPACE
+#  error "CONFIG_NUTTX_USERSPACE not defined"
+#endif
+
+#if CONFIG_NUTTX_USERSPACE != 0x08020000
+#  error "CONFIG_NUTTX_USERSPACE must be 0x08020000 to match memory.ld"
+#endif
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* These 'addresses' of these values are setup by the linker script. They are
+ * not actual uint32_t storage locations! They are only used meaningfully in
+ * the following way:
+ *
+ *  - The linker script defines, for example, the symbol_sdata.
+ *  - The declaration extern uint32_t _sdata; makes C happy.  C will believe
+ *    that the value _sdata is the address of a uint32_t variable _data (it
+ *    is not!).
+ *  - We can recover the linker value then by simply taking the address of
+ *    of _data.  like:  uint32_t *pdata = &_sdata;
+ */
+
+extern uint32_t _stext;           /* Start of .text */
+extern uint32_t _etext;           /* End_1 of .text + .rodata */
+extern const uint32_t _eronly;    /* End+1 of read only section (.text + .rodata) */
+extern uint32_t _sdata;           /* Start of .data */
+extern uint32_t _edata;           /* End+1 of .data */
+extern uint32_t _sbss;            /* Start of .bss */
+extern uint32_t _ebss;            /* End+1 of .bss */
+
+/* This is the user space entry point */
+
+int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);

Review comment:
       ```suggestion
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/Makefile
##########
@@ -0,0 +1,103 @@
+############################################################################
+# boards/arm/stm32h7/portenta-h7/kernel/Makefile
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(TOPDIR)/Make.defs
+
+# The entry point name (if none is provided in the .config file)
+
+CONFIG_USER_ENTRYPOINT ?= user_start
+ENTRYPT = $(patsubst "%",%,$(CONFIG_USER_ENTRYPOINT))
+
+# Get the paths to the libraries and the links script path in format that
+# is appropriate for the host OS
+
+ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
+  # Windows-native toolchains
+  USER_LIBPATHS = ${shell for path in $(USERLIBS); do dir=`dirname $(TOPDIR)$(DELIM)$$path`;echo "-L\"`cygpath -w $$dir`\"";done}
+  USER_LDSCRIPT = -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)memory.ld}"
+  USER_LDSCRIPT += -T "${shell cygpath -w $(BOARD_DIR)$(DELIM)scripts$(DELIM)user-space.ld}"
+  USER_HEXFILE += "${shell cygpath -w $(TOPDIR)$(DELIM)nuttx_user.hex}"
+  USER_SRECFILE += "${shell cygpath -w $(TOPDIR)$(DELIM)nuttx_user.srec}"
+  USER_BINFILE += "${shell cygpath -w $(TOPDIR)$(DELIM)nuttx_user.bin}"
+else
+  # Linux/Cygwin-native toolchain
+  USER_LIBPATHS = $(addprefix -L$(TOPDIR)$(DELIM),$(dir $(USERLIBS)))
+  USER_LDSCRIPT = -T$(BOARD_DIR)$(DELIM)scripts$(DELIM)memory.ld
+  USER_LDSCRIPT += -T$(BOARD_DIR)$(DELIM)scripts$(DELIM)user-space.ld
+  USER_HEXFILE += "$(TOPDIR)$(DELIM)nuttx_user.hex"
+  USER_SRECFILE += "$(TOPDIR)$(DELIM)nuttx_user.srec"
+  USER_BINFILE += "$(TOPDIR)$(DELIM)nuttx_user.bin"
+endif

Review comment:
       Please rework this as in other in-tree boards.

##########
File path: boards/arm/stm32h7/portenta-h7/include/board.h
##########
@@ -0,0 +1,368 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/include/board.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+#define __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H

Review comment:
       ```suggestion
   #ifndef __BOARDS_ARM_STM32H7_PORTENTA_H7_INCLUDE_BOARD_H
   #define __BOARDS_ARM_STM32H7_PORTENTA_H7_INCLUDE_BOARD_H
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/mm/mm.h>
+#include <nuttx/wqueue.h>
+#include <nuttx/userspace.h>
+
+#if defined(CONFIG_BUILD_PROTECTED) && !defined(__KERNEL__)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+#ifndef CONFIG_NUTTX_USERSPACE
+#  error "CONFIG_NUTTX_USERSPACE not defined"
+#endif
+
+#if CONFIG_NUTTX_USERSPACE != 0x08020000
+#  error "CONFIG_NUTTX_USERSPACE must be 0x08020000 to match memory.ld"
+#endif
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/* These 'addresses' of these values are setup by the linker script. They are
+ * not actual uint32_t storage locations! They are only used meaningfully in
+ * the following way:
+ *
+ *  - The linker script defines, for example, the symbol_sdata.
+ *  - The declaration extern uint32_t _sdata; makes C happy.  C will believe
+ *    that the value _sdata is the address of a uint32_t variable _data (it
+ *    is not!).
+ *  - We can recover the linker value then by simply taking the address of
+ *    of _data.  like:  uint32_t *pdata = &_sdata;
+ */
+
+extern uint32_t _stext;           /* Start of .text */
+extern uint32_t _etext;           /* End_1 of .text + .rodata */
+extern const uint32_t _eronly;    /* End+1 of read only section (.text + .rodata) */
+extern uint32_t _sdata;           /* Start of .data */
+extern uint32_t _edata;           /* End+1 of .data */
+extern uint32_t _sbss;            /* Start of .bss */
+extern uint32_t _ebss;            /* End+1 of .bss */
+
+/* This is the user space entry point */
+
+int CONFIG_USER_ENTRYPOINT(int argc, char *argv[]);
+
+const struct userspace_s userspace __attribute__ ((section (".userspace"))) =

Review comment:
       Optional. We can use `locate_code()` macro

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdlib.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/mm/mm.h>

Review comment:
       ```suggestion
   #include <nuttx/init.h>
   #include <nuttx/mm/mm.h>
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/Make.defs
##########
@@ -0,0 +1,59 @@
+############################################################################
+# boards/arm/stm32h7/portenta-h7/scripts/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(TOPDIR)/.config
+include $(TOPDIR)/tools/Config.mk
+include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
+
+LDSCRIPT = flash.ld
+
+ARCHSCRIPT += $(BOARD_DIR)$(DELIM)scripts$(DELIM)$(LDSCRIPT)
+
+ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
+  ARCHOPTIMIZATION = -g
+endif
+
+ifneq ($(CONFIG_DEBUG_NOOPT),y)
+  ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fcheck-new -fno-rtti
+ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
+ARCHWARNINGSXX = -Wall -Wshadow -Wundef
+ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10

Review comment:
       Please sync this file with other stm32 in-tree boards file. `-fno-builtin` have been removed recently. Maybe other places were reworked. The `make` related files seems to be behind latest mainline `make` infrastructure

##########
File path: boards/arm/stm32h7/portenta-h7/src/portenta-h7.h
##########
@@ -0,0 +1,161 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/portenta-h7.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_STM32H747I_DISCO_SRC_STM32H747I_DISCO_H
+#define __BOARDS_ARM_STM32H7_STM32H747I_DISCO_SRC_STM32H747I_DISCO_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+
+#include <stdint.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* procfs File System */
+
+#ifdef CONFIG_FS_PROCFS
+#  ifdef CONFIG_NSH_PROC_MOUNTPOINT
+#    define STM32_PROCFS_MOUNTPOINT CONFIG_NSH_PROC_MOUNTPOINT
+#  else
+#    define STM32_PROCFS_MOUNTPOINT "/proc"
+#  endif
+#endif
+
+/* Check if we can support the RTC driver */
+
+#define HAVE_RTC_DRIVER 1
+#if !defined(CONFIG_RTC) || !defined(CONFIG_RTC_DRIVER)
+#  undef HAVE_RTC_DRIVER
+#endif
+
+/* LED
+ *
+ * LED3 Red     PK5
+ * LED1 Green   PK6
+ * LED4 Blue    PK7
+ */
+
+#define GPIO_LED1        (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \
+                         GPIO_PORTK | GPIO_PIN5)
+#define GPIO_LED2        (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \
+                         GPIO_PORTK | GPIO_PIN6)
+#define GPIO_LED3        (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \
+                         GPIO_PORTK | GPIO_PIN7)
+
+#define GPIO_LED_RED    GPIO_LED1
+#define GPIO_LED_GREEN  GPIO_LED2
+#define GPIO_LED_BLUE   GPIO_LED3
+
+#define LED_DRIVER_PATH "/dev/userleds"
+
+#define GPIO_OSCEN      (GPIO_OUTPUT | GPIO_PUSHPULL | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \
+                         GPIO_PORTH | GPIO_PIN1)
+
+/* SD/TF Card'detected pin */
+
+#if defined(CONFIG_STM32H7_SDMMC1)
+#  define HAVE_SDIO
+#endif
+
+#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_MMCSD_SDIO)
+#  undef HAVE_SDIO
+#endif
+
+#define GPIO_SDIO_NCD      (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTI|GPIO_PIN8)
+
+#define SDIO_SLOTNO        0
+#define SDIO_MINOR         0
+
+/****************************************************************************
+ * Name: stm32_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
+ *     Called from the NSH library
+ *
+ ****************************************************************************/
+
+int stm32_bringup(void);
+
+/****************************************************************************
+ * Name: stm32_spidev_initialize
+ *
+ * Description:
+ *   Called to configure SPI chip select GPIO pins for the board.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32H7_SPI
+void stm32_spidev_initialize(void);
+#endif
+
+/****************************************************************************
+ * Name: stm32_adc_setup
+ *
+ * Description:
+ *   Initialize ADC and register the ADC driver.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_ADC
+int stm32_adc_setup(void);
+#endif
+
+/****************************************************************************
+ * Name: stm32_dma_alloc_init
+ *
+ * Description:
+ *   Called to create a FAT DMA allocator
+ *
+ * Returned Value:
+ *   0 on success or -ENOMEM
+ *
+ ****************************************************************************/
+
+#if defined (CONFIG_FAT_DMAMEMORY)
+int stm32_dma_alloc_init(void);
+#endif
+
+/****************************************************************************
+ * Name: stm32_sdio_initialize
+ *
+ * Description:
+ *   Initialize SDIO-based MMC/SD card support
+ *
+ ****************************************************************************/
+
+#ifdef HAVE_SDIO
+int stm32_sdio_initialize(void);
+#endif
+
+#endif /* __BOARDS_ARM_STM32H7_STM32H747I_DISCO_SRC_STM32H747I_DISCO_H */

Review comment:
       ```suggestion
   #endif /* __BOARDS_ARM_STM32H7_PORTENA_H7_SRC_PORTENA_H7_H */
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_dma_alloc.c
##########
@@ -0,0 +1,105 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_dma_alloc.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <syslog.h>
+#include <stdint.h>
+#include <errno.h>
+#include <nuttx/mm/gran.h>
+
+#include "portenta-h7.h"
+
+#if defined(CONFIG_FAT_DMAMEMORY)
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if !defined(CONFIG_GRAN)
+#  error microSD DMA support requires CONFIG_GRAN
+#endif
+
+#define BOARD_DMA_ALLOC_POOL_SIZE (8*512)
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static GRAN_HANDLE dma_allocator;
+
+/* The DMA heap size constrains the total number of things that can be
+ * ready to do DMA at a time.
+ *
+ * For example, FAT DMA depends on one sector-sized buffer per
+ * filesystem plus one sector-sized buffer per file.
+ *
+ * We use a fundamental alignment / granule size of 64B; this is
+ * sufficient to guarantee alignment for the largest STM32 DMA burst
+ * (16 beats x 32bits).
+ */
+
+static uint8_t g_dma_heap[BOARD_DMA_ALLOC_POOL_SIZE]
+                __attribute__((aligned(64)));

Review comment:
       Optional. As an alternative `aligned_data` can be used

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
##########
@@ -0,0 +1,211 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/board.h>
+#include <nuttx/analog/adc.h>
+#include <arch/board/board.h>
+
+#include "chip.h"
+#include "stm32_gpio.h"
+#include "stm32_adc.h"
+#include "portenta-h7.h"
+
+#ifdef CONFIG_ADC
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* Up to 3 ADC interfaces are supported */
+
+#if defined(CONFIG_STM32H7_ADC1) || defined(CONFIG_STM32H7_ADC2) || \
+    defined(CONFIG_STM32H7_ADC3)
+#ifndef CONFIG_STM32H7_ADC1
+#  warning "Channel information only available for ADC1"
+#endif
+
+/* The number of ADC channels in the conversion list */
+
+#define ADC1_NCHANNELS 5
+#define ADC3_NCHANNELS 1
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32H7_ADC1
+/* Identifying number of each ADC channel: Variable Resistor.
+ *
+ * ADC1: {5, 10, 12, 13, 15};
+ */
+
+static const uint8_t  g_adc1_chanlist[ADC1_NCHANNELS] =
+{
+  5, 10, 12, 13, 15
+};
+
+/* Configurations of pins used by each ADC channels
+ *
+ * ADC1: {GPIO_ADC12_INP5, GPIO_ADC123_INP10, GPIO_ADC123_INP12,
+ *        GPIO_ADC12_INP13, GPIO_ADC12_INP15};
+ */
+
+static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] =
+{
+  GPIO_ADC12_INP5, GPIO_ADC123_INP10, GPIO_ADC123_INP12, GPIO_ADC12_INP13,
+  GPIO_ADC12_INP15
+};
+#endif
+
+#ifdef CONFIG_STM32H7_ADC3
+/* Identifying number of each ADC channel: Variable Resistor.
+ *
+ * ADC3: {6,};
+ */
+
+static const uint8_t  g_adc3_chanlist[ADC1_NCHANNELS] =
+{
+  6
+};
+
+/* Configurations of pins used by each ADC channels
+ *
+ *
+ * ADC3: {GPIO_ADC3_INP6}
+ */
+
+static const uint32_t g_adc3_pinlist[ADC3_NCHANNELS] =
+{
+  GPIO_ADC3_INP6
+};
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_adc_setup
+ *
+ * Description:
+ *   Initialize ADC and register the ADC driver.
+ *
+ ****************************************************************************/
+
+int stm32_adc_setup(void)
+{
+#if defined(CONFIG_STM32H7_ADC1) || defined(CONFIG_STM32H7_ADC3)
+  static bool initialized = false;

Review comment:
       ```suggestion
     static bool initialized;
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
##########
@@ -0,0 +1,211 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include <debug.h>
+
+#include <nuttx/board.h>
+#include <nuttx/analog/adc.h>
+#include <arch/board/board.h>
+
+#include "chip.h"
+#include "stm32_gpio.h"
+#include "stm32_adc.h"
+#include "portenta-h7.h"
+
+#ifdef CONFIG_ADC
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Configuration ************************************************************/
+
+/* Up to 3 ADC interfaces are supported */
+
+#if defined(CONFIG_STM32H7_ADC1) || defined(CONFIG_STM32H7_ADC2) || \
+    defined(CONFIG_STM32H7_ADC3)
+#ifndef CONFIG_STM32H7_ADC1
+#  warning "Channel information only available for ADC1"
+#endif
+
+/* The number of ADC channels in the conversion list */
+
+#define ADC1_NCHANNELS 5
+#define ADC3_NCHANNELS 1
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_STM32H7_ADC1
+/* Identifying number of each ADC channel: Variable Resistor.
+ *
+ * ADC1: {5, 10, 12, 13, 15};
+ */
+
+static const uint8_t  g_adc1_chanlist[ADC1_NCHANNELS] =
+{
+  5, 10, 12, 13, 15
+};
+
+/* Configurations of pins used by each ADC channels
+ *
+ * ADC1: {GPIO_ADC12_INP5, GPIO_ADC123_INP10, GPIO_ADC123_INP12,
+ *        GPIO_ADC12_INP13, GPIO_ADC12_INP15};
+ */
+
+static const uint32_t g_adc1_pinlist[ADC1_NCHANNELS] =
+{
+  GPIO_ADC12_INP5, GPIO_ADC123_INP10, GPIO_ADC123_INP12, GPIO_ADC12_INP13,
+  GPIO_ADC12_INP15
+};
+#endif
+
+#ifdef CONFIG_STM32H7_ADC3
+/* Identifying number of each ADC channel: Variable Resistor.
+ *
+ * ADC3: {6,};
+ */
+
+static const uint8_t  g_adc3_chanlist[ADC1_NCHANNELS] =
+{
+  6
+};
+
+/* Configurations of pins used by each ADC channels
+ *
+ *
+ * ADC3: {GPIO_ADC3_INP6}
+ */
+
+static const uint32_t g_adc3_pinlist[ADC3_NCHANNELS] =
+{
+  GPIO_ADC3_INP6
+};
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_adc_setup
+ *
+ * Description:
+ *   Initialize ADC and register the ADC driver.
+ *
+ ****************************************************************************/
+
+int stm32_adc_setup(void)
+{
+#if defined(CONFIG_STM32H7_ADC1) || defined(CONFIG_STM32H7_ADC3)
+  static bool initialized = false;
+  struct adc_dev_s *adc;
+  int ret;
+  int i;
+  char devname[] = "/dev/adc0";

Review comment:
       Optional
   ```suggestion
     const char *devname = "/dev/adc0";
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
##########
@@ -0,0 +1,311 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sched.h>
+#include <errno.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/kthread.h>
+#include <nuttx/usb/usbdev.h>
+#include <nuttx/usb/usbhost.h>
+#include <nuttx/usb/usbdev_trace.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+#include "stm32_gpio.h"
+#include "stm32_otg.h"
+#include "portenta-h7.h"
+
+#ifdef CONFIG_STM32H7_OTGHS
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
+#  define HAVE_USB 1
+#else
+#  warning "CONFIG_STM32H7_OTGHS is enabled but neither CONFIG_USBDEV nor CONFIG_USBHOST"
+#  undef HAVE_USB
+#endif
+
+#ifndef CONFIG_STM32H747XI_DISCO_USBHOST_PRIO
+#  define CONFIG_STM32H747XI_DISCO_USBHOST_PRIO 100
+#endif
+
+#ifndef CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE
+#  define CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE 1024
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+static struct usbhost_connection_s *g_usbconn;
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: usbhost_waiter
+ *
+ * Description:
+ *   Wait for USB devices to be connected.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+static int usbhost_waiter(int argc, char *argv[])
+{
+  struct usbhost_hubport_s *hport;
+
+  uinfo("Running\n");
+  for (; ; )
+    {
+      /* Wait for the device to change state */
+
+      DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport));
+      uinfo("%s\n", hport->connected ? "connected" : "disconnected");
+
+      /* Did we just become connected? */
+
+      if (hport->connected)
+        {
+          /* Yes.. enumerate the newly connected device */
+
+          (void)CONN_ENUMERATE(g_usbconn, hport);
+        }
+    }
+
+  /* Keep the compiler from complaining */
+
+  return 0;
+}
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_usbinitialize
+ *
+ * Description:
+ *   Called from stm32_usbinitialize very early in inialization to setup
+ *   USB-related GPIO pins for the STM32H747I DISCO board.
+ *
+ ****************************************************************************/
+
+void stm32_usbinitialize(void)
+{
+  /* Configure the Overcurrent GPIO */
+
+#ifdef CONFIG_STM32H7_OTGHS
+  stm32_configgpio(GPIO_OTGHS_OVER);
+#endif
+}
+
+/****************************************************************************
+ * Name: stm32_usbhost_initialize
+ *
+ * Description:
+ *   Called at application startup time to initialize the USB host
+ *   functionality.  This function will start a thread that will monitor for
+ *   device connection/disconnection events.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+int stm32_usbhost_initialize(void)
+{
+  int pid;
+#if defined(CONFIG_USBHOST_HUB)    || defined(CONFIG_USBHOST_MSC) || \
+    defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
+  int ret;
+#endif

Review comment:
       ```suggestion
     int ret;
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_uid.c
##########
@@ -0,0 +1,55 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_uid.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <errno.h>
+#include "stm32_uid.h"
+
+#include <nuttx/board.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef OK
+#  define OK 0
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+#if defined(CONFIG_BOARDCTL_UNIQUEID)
+int board_uniqueid(uint8_t *uniqueid)
+{
+  if (uniqueid == 0)

Review comment:
       ```suggestion
     if (uniqueid == NULL)
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_bringup.c
##########
@@ -0,0 +1,224 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_bringup.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <syslog.h>
+#include <errno.h>
+
+#include "portenta-h7.h"
+
+#include <nuttx/fs/fs.h>
+
+#ifdef CONFIG_BUTTONS
+#  include <nuttx/input/buttons.h>
+#endif
+
+#ifdef HAVE_RTC_DRIVER
+#  include <nuttx/timers/rtc.h>
+#  include "stm32_rtc.h"
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_i2c_register
+ *
+ * Description:
+ *   Register one I2C drivers for the I2C tool.
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_I2C) && defined(CONFIG_SYSTEM_I2CTOOL)
+static void stm32_i2c_register(int bus)
+{
+  FAR struct i2c_master_s *i2c;
+  int ret;
+
+  i2c = stm32_i2cbus_initialize(bus);
+  if (i2c == NULL)
+    {
+      syslog(LOG_ERR, "ERROR: Failed to get I2C%d interface\n", bus);
+    }
+  else
+    {
+      ret = i2c_register(i2c, bus);
+      if (ret < 0)
+        {
+          syslog(LOG_ERR, "ERROR: Failed to register I2C%d driver: %d\n",
+                 bus, ret);
+          stm32_i2cbus_uninitialize(i2c);
+        }
+    }
+}
+#endif
+
+/****************************************************************************
+ * Name: stm32_i2ctool
+ *
+ * Description:
+ *   Register I2C drivers for the I2C tool.
+ *
+ ****************************************************************************/
+
+#if defined(CONFIG_I2C) && defined(CONFIG_SYSTEM_I2CTOOL)
+static void stm32_i2ctool(void)
+{
+#ifdef CONFIG_STM32H7_I2C1
+  stm32_i2c_register(1);
+#endif
+#ifdef CONFIG_STM32H7_I2C2
+  stm32_i2c_register(2);
+#endif
+#ifdef CONFIG_STM32H7_I2C3
+  stm32_i2c_register(3);
+#endif
+#ifdef CONFIG_STM32H7_I2C4
+  stm32_i2c_register(4);
+#endif
+}
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_bringup
+ *
+ * Description:
+ *   Perform architecture-specific initialization
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=y :
+ *     Called from board_late_initialize().
+ *
+ *   CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_BOARDCTL=y &&
+ *   CONFIG_NSH_ARCHINIT:
+ *     Called from the NSH library
+ *
+ ****************************************************************************/
+
+int stm32_bringup(void)
+{
+  int ret = OK;
+#ifdef HAVE_RTC_DRIVER
+  FAR struct rtc_lowerhalf_s *lower;
+#endif
+
+  UNUSED(ret);
+
+#if defined(CONFIG_I2C) && defined(CONFIG_SYSTEM_I2CTOOL)
+  stm32_i2ctool();
+#endif
+
+#ifdef CONFIG_FS_PROCFS
+#ifdef CONFIG_STM32_CCM_PROCFS
+  /* Register the CCM procfs entry.  This must be done before the procfs is
+   * mounted.
+   */
+
+  (void)ccm_procfs_register();
+#endif /* CONFIG_STM32_CCM_PROCFS */
+
+  /* Mount the procfs file system */
+
+  ret = nx_mount(NULL, STM32_PROCFS_MOUNTPOINT, "procfs", 0, NULL);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR,
+             "ERROR: Failed to mount the PROC filesystem: %d\n", ret);
+    }
+#endif /* CONFIG_FS_PROCFS */
+
+#ifdef CONFIG_FS_TMPFS
+  /* Mount the tmpfs file system */
+
+  ret = nx_mount(NULL, CONFIG_LIBC_TMPDIR, "tmpfs", 0, NULL);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: Failed to mount tmpfs at %s: %d\n",
+             CONFIG_LIBC_TMPDIR, ret);
+    }
+#endif
+
+#ifdef HAVE_RTC_DRIVER
+  /* Instantiate the STM32 lower-half RTC driver */
+
+  lower = stm32_rtc_lowerhalf();
+  if (!lower)

Review comment:
       ```suggestion
     if (lower == NULL)
   ```

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
##########
@@ -0,0 +1,311 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <sched.h>
+#include <errno.h>
+#include <assert.h>
+#include <debug.h>
+
+#include <nuttx/kthread.h>
+#include <nuttx/usb/usbdev.h>
+#include <nuttx/usb/usbhost.h>
+#include <nuttx/usb/usbdev_trace.h>
+
+#include "arm_internal.h"
+#include "chip.h"
+#include "stm32_gpio.h"
+#include "stm32_otg.h"
+#include "portenta-h7.h"
+
+#ifdef CONFIG_STM32H7_OTGHS
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#if defined(CONFIG_USBDEV) || defined(CONFIG_USBHOST)
+#  define HAVE_USB 1
+#else
+#  warning "CONFIG_STM32H7_OTGHS is enabled but neither CONFIG_USBDEV nor CONFIG_USBHOST"
+#  undef HAVE_USB
+#endif
+
+#ifndef CONFIG_STM32H747XI_DISCO_USBHOST_PRIO
+#  define CONFIG_STM32H747XI_DISCO_USBHOST_PRIO 100
+#endif
+
+#ifndef CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE
+#  define CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE 1024
+#endif
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+static struct usbhost_connection_s *g_usbconn;
+#endif
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: usbhost_waiter
+ *
+ * Description:
+ *   Wait for USB devices to be connected.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+static int usbhost_waiter(int argc, char *argv[])
+{
+  struct usbhost_hubport_s *hport;
+
+  uinfo("Running\n");
+  for (; ; )
+    {
+      /* Wait for the device to change state */
+
+      DEBUGVERIFY(CONN_WAIT(g_usbconn, &hport));
+      uinfo("%s\n", hport->connected ? "connected" : "disconnected");
+
+      /* Did we just become connected? */
+
+      if (hport->connected)
+        {
+          /* Yes.. enumerate the newly connected device */
+
+          (void)CONN_ENUMERATE(g_usbconn, hport);
+        }
+    }
+
+  /* Keep the compiler from complaining */
+
+  return 0;
+}
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: stm32_usbinitialize
+ *
+ * Description:
+ *   Called from stm32_usbinitialize very early in inialization to setup
+ *   USB-related GPIO pins for the STM32H747I DISCO board.
+ *
+ ****************************************************************************/
+
+void stm32_usbinitialize(void)
+{
+  /* Configure the Overcurrent GPIO */
+
+#ifdef CONFIG_STM32H7_OTGHS
+  stm32_configgpio(GPIO_OTGHS_OVER);
+#endif
+}
+
+/****************************************************************************
+ * Name: stm32_usbhost_initialize
+ *
+ * Description:
+ *   Called at application startup time to initialize the USB host
+ *   functionality.  This function will start a thread that will monitor for
+ *   device connection/disconnection events.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_USBHOST
+int stm32_usbhost_initialize(void)
+{
+  int pid;
+#if defined(CONFIG_USBHOST_HUB)    || defined(CONFIG_USBHOST_MSC) || \
+    defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE)
+  int ret;
+#endif
+
+  /* First, register all of the class drivers needed to support the drivers
+   * that we care about:
+   */
+
+  uinfo("Register class drivers\n");
+
+#ifdef CONFIG_USBHOST_HUB
+  /* Initialize USB hub class support */
+
+  ret = usbhost_hub_initialize();
+  if (ret < 0)
+    {
+      uerr("ERROR: usbhost_hub_initialize failed: %d\n", ret);
+    }
+#endif
+
+#ifdef CONFIG_USBHOST_MSC
+  /* Register the USB mass storage class class */
+
+  ret = usbhost_msc_initialize();
+  if (ret != OK)
+    {
+      uerr("ERROR: Failed to register the mass storage class: %d\n", ret);
+    }
+#endif
+
+#ifdef CONFIG_USBHOST_CDCACM
+  /* Register the CDC/ACM serial class */
+
+  ret = usbhost_cdcacm_initialize();
+  if (ret != OK)
+    {
+      uerr("ERROR: Failed to register the CDC/ACM serial class: %d\n", ret);
+    }
+#endif
+
+#ifdef CONFIG_USBHOST_HIDKBD
+  /* Initialize the HID keyboard class */
+
+  ret = usbhost_kbdinit();
+  if (ret != OK)
+    {
+      uerr("ERROR: Failed to register the HID keyboard class\n");
+    }
+#endif
+
+#ifdef CONFIG_USBHOST_HIDMOUSE
+  /* Initialize the HID mouse class */
+
+  ret = usbhost_mouse_init();
+  if (ret != OK)
+    {
+      uerr("ERROR: Failed to register the HID mouse class\n");
+    }
+#endif
+
+  /* Then get an instance of the USB host interface */
+
+  uinfo("Initialize USB host\n");
+  g_usbconn = stm32_otghshost_initialize(0);
+  if (g_usbconn)
+    {
+      /* Start a thread to handle device connection. */
+
+      uinfo("Start usbhost_waiter\n");
+
+      pid = kthread_create("usbhost", CONFIG_STM32H747XI_DISCO_USBHOST_PRIO,
+                           CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE,
+                           (main_t)usbhost_waiter, (FAR char * const *)NULL);
+      return pid < 0 ? -ENOEXEC : OK;

Review comment:
       ```suggestion
         ret = kthread_create("usbhost", CONFIG_STM32H747XI_DISCO_USBHOST_PRIO,
                              CONFIG_STM32H747XI_DISCO_USBHOST_STACKSIZE,
                              (main_t)usbhost_waiter, (FAR char * const *)NULL);
         return ret < 0 ? -ENOEXEC : OK;
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r835506956



##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_userleds.c
##########
@@ -0,0 +1,151 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_userleds.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_userleds.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.

Review comment:
       @antmerlino I think that you as the author can resolve this open reviews now. I see that you fixed it in the 0619a06f56421ff6e00ddd2a111ec454504d976b




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079593891


   @antmerlino I tried to build it on my environment and I had the same error:
   
   ```
   ./stm32_boot.c:32:10: fatal error: arm_arch.h: No such file or directory
      32 | #include "arm_arch.h"
         |          ^~~~~~~~~~~~
   compilation terminated.
   ERROR: arm-none-eabi-gcc failed: 1
          command: arm-none-eabi-gcc -M '-fno-builtin' '-Wall' '-Wstrict-prototypes' '-Wshadow' '-Wundef' '-g' '-Os' '-fomit-frame-pointer' '-fno-strict-aliasing' '-fno-strength-reduce' '-fomit-frame-pointer' '-march=armv7e-m' '-mtune=cortex-m7' '-mthumb' '-mfpu=fpv5-d16' '-mfloat-abi=hard' '-isystem' '/home/castello/projects/N/dotnuttx/nuttx/include' '-D__NuttX__' '-DNDEBUG' '-D__KERNEL__' '-pipe' '-I' '/home/castello/projects/N/dotnuttx/nuttx/sched' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/chip' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/common' '-I' '/home/castello/projects/N/dotnuttx/nuttx/arch/arm/src/armv7-m' ./stm32_boot.c
   ```
   
   With the rebase something from master degraded the portenta build 😔


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837484406



##########
File path: boards/arm/stm32h7/portenta-h7/scripts/flash.ld
##########
@@ -0,0 +1,210 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/flash.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld
+ *
+ *   Copyright (C) 2018 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       @microhobby ditto




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] antmerlino commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
antmerlino commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-903031683


   > @antmerlino do you intend to continue with this contribution?
   
   @microhobby I don't plan to develop the Portenta platform further, but I would like to find the time to finish this basic support and get it merged. Just hasn't been a priority.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837483473



##########
File path: boards/arm/stm32h7/portenta-h7/include/board.h
##########
@@ -0,0 +1,368 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/include/board.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+#define __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Do not include STM32 H7 header files here */
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Clocking *****************************************************************/
+
+/* The board provides the following clock sources:
+ *
+ *  NOTE: The documentation and schematics claim that there is a 27MHz
+ *  oscillator for HSE. However, after much headache, it was measured
+ *  to actually be 25MHz. Looking at some mbed code validates that they
+ *  are using 25MHz as the HSE clock. This was further confirmed with the
+ *  Arduino staff.
+ *
+ *   U18: 25MHz HSE MEMS Oscillator
+ *   Y1:  32768Hz LSE crystal oscillator
+ *
+ * So we have these clock source available within the STM32
+ *
+ *   HSI: 64 MHz RC factory-trimmed
+ *   LSI: 32 KHz RC
+ *   HSE: 27 MHz oscillator
+ *   LSE: 32.768 kHz
+ */
+
+#define STM32_HSI_FREQUENCY     16000000ul
+#define STM32_LSI_FREQUENCY     32000
+#define STM32_HSE_FREQUENCY     25000000ul
+#define STM32_LSE_FREQUENCY     32768
+
+#define STM32_BOARD_USEHSE
+#define STM32_HSEBYP_ENABLE
+
+/* Main PLL Configuration.
+ *
+ * PLL source is HSE = 25,000,000
+ *
+ * When STM32_HSE_FREQUENCY / PLLM <= 2MHz VCOL must be selected.
+ * VCOH otherwise.
+ *
+ * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
+ * Subject to:
+ *
+ *     1 <= PLLM <= 63
+ *     4 <= PLLN <= 512
+ *   150 MHz <= PLL_VCOL <= 420MHz
+ *   192 MHz <= PLL_VCOH <= 836MHz
+ *
+ * SYSCLK  = PLL_VCO / PLLP
+ * CPUCLK  = SYSCLK / D1CPRE
+ * Subject to
+ *
+ *   PLLP1   = {2, 4, 6, 8, ..., 128}
+ *   PLLP2,3 = {2, 3, 4, ..., 128}
+ *   CPUCLK <= 480 MHz
+ */
+
+#define STM32_PLLCFG_PLLSRC      RCC_PLLCKSELR_PLLSRC_HSE
+
+/* PLL1, wide 2 - 4 MHz input, enable DIVP, DIVQ, DIVR
+ *
+ *   PLL1_VCO = (25,000,000 / 5) * 160 = 800 MHz
+ *
+ *   PLL1P = PLL1_VCO/2  = 960 MHz / 2   = 400 MHz
+ *   PLL1Q = PLL1_VCO/4  = 960 MHz / 4   = 200 MHz
+ *   PLL1R = PLL1_VCO/8  = 960 MHz / 8   = 100 MHz
+ */
+
+#define STM32_PLLCFG_PLL1CFG     (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
+                                  RCC_PLLCFGR_PLL1RGE_2_4_MHZ | \
+                                  RCC_PLLCFGR_DIVP1EN | \
+                                  RCC_PLLCFGR_DIVQ1EN | \
+                                  RCC_PLLCFGR_DIVR1EN)
+#define STM32_PLLCFG_PLL1M       RCC_PLLCKSELR_DIVM1(5)
+#define STM32_PLLCFG_PLL1N       RCC_PLL1DIVR_N1(160)
+#define STM32_PLLCFG_PLL1P       RCC_PLL1DIVR_P1(2)
+#define STM32_PLLCFG_PLL1Q       RCC_PLL1DIVR_Q1(4)
+#define STM32_PLLCFG_PLL1R       RCC_PLL1DIVR_R1(8)
+
+#define STM32_VCO1_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL1P_FREQUENCY    (STM32_VCO1_FREQUENCY / 2)
+#define STM32_PLL1Q_FREQUENCY    (STM32_VCO1_FREQUENCY / 4)
+#define STM32_PLL1R_FREQUENCY    (STM32_VCO1_FREQUENCY / 8)
+
+/* PLL2 */
+
+#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
+                              RCC_PLLCFGR_PLL2RGE_2_4_MHZ | \
+                              RCC_PLLCFGR_DIVP2EN)
+#define STM32_PLLCFG_PLL2M       RCC_PLLCKSELR_DIVM2(5)
+#define STM32_PLLCFG_PLL2N       RCC_PLL2DIVR_N2(160)
+#define STM32_PLLCFG_PLL2P       RCC_PLL2DIVR_P2(2)
+#define STM32_PLLCFG_PLL2Q       RCC_PLL2DIVR_Q2(4)
+#define STM32_PLLCFG_PLL2R       RCC_PLL2DIVR_R2(8)
+
+#define STM32_VCO2_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL2P_FREQUENCY    (STM32_VCO2_FREQUENCY / 2)
+#define STM32_PLL2Q_FREQUENCY    (STM32_VCO2_FREQUENCY / 4)
+#define STM32_PLL2R_FREQUENCY    (STM32_VCO2_FREQUENCY / 8)
+
+/* PLL3 */
+
+#define STM32_PLLCFG_PLL3CFG 0
+#define STM32_PLLCFG_PLL3M   0
+#define STM32_PLLCFG_PLL3N   0
+#define STM32_PLLCFG_PLL3P   0
+#define STM32_PLLCFG_PLL3Q   0
+#define STM32_PLLCFG_PLL3R   0
+
+#define STM32_VCO3_FREQUENCY
+#define STM32_PLL3P_FREQUENCY
+#define STM32_PLL3Q_FREQUENCY
+#define STM32_PLL3R_FREQUENCY

Review comment:
       @microhobby could you please answer this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-807588911


   Hi @antmerlino please fix the coding style issues and other issues.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079594751


   @antmerlino this commit, we need to change also the portenta stm32_boot.c https://github.com/dotnuttx/incubator-nuttx/commit/54e630e14d7e32d6f81ae79d4e5df3d2fa787ef0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837520676



##########
File path: boards/arm/stm32h7/portenta-h7/scripts/flash.ld
##########
@@ -0,0 +1,210 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/flash.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld
+ *
+ *   Copyright (C) 2018 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       @antmerlino some files are still missing the fix for the apache license




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby removed a comment on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby removed a comment on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1081812585


   @pkarashchenko @acassis I think this is good for merge ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby edited a comment on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby edited a comment on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079594751


   @antmerlino this commit, we need to change also the portenta `stm32_boot.c` https://github.com/dotnuttx/incubator-nuttx/commit/54e630e14d7e32d6f81ae79d4e5df3d2fa787ef0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837520382



##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       @antmerlino some files are still missing the fix for the apache license




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-904357468


   🤔 setting flash section to `0x0804000` and defining `# CONFIG_ARMV7M_DCACHE is not set` to the `defconfig` made a  working `nsh` through the default DFU bootloader from Portenta. But to be honest I'm not sure if this has any side effects ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-904702490


   > @microhobby this offset 0x0804000 should depend of CONFIG_STM32H7_DFU please search for CONFIG_STM32_DFU for reference (it is defined at arch/arm/src/stm32/Kconfig)
   
   Yeah, I did exactly this! Thanks @acassis. For now my changes are here: https://github.com/dotnuttx/incubator-nuttx/commit/51e57d048d67456a1287f8256b3115f119b80f23


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079297489


   @antmerlino you still need to rebase your https://github.com/antmerlino/incubator-nuttx/tree/arduino-portenta with the https://github.com/apache/incubator-nuttx/tree/master . I think this would solve the checks issues, thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-899082822


   @antmerlino do you intend to continue with this contribution? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-903128051


   > > @antmerlino do you intend to continue with this contribution?
   > 
   > @microhobby I don't plan to develop the Portenta platform further, but I would like to find the time to finish this basic support and get it merged. Just hasn't been a priority.
   
   @antmerlino ok, no problem, I would like to help. I'm working on a linker to use DFU bootloader, as I don't have any breakout with access to programmer pins. But now I'm stuck in a hardfault:
   
   ```
   up_assert: Assertion failed at file:irq/irq_unexpectedisr.c line: 51
   up_registerdump: R0: 0000001e 00000000 e000ed14 00070200 e000ed0b ffffffff e000e100 00000000
   up_registerdump: R8: 00000000 00000000 24070000 00000000 00000018 24000f38 08041381 00000000
   up_registerdump: xPSR: 00000200 PRIMASK: 00000000 CONTROL: 00000000
   up_registerdump: EXC_RETURN: ffffffe9
   ```
   
   Can you confirm that with your patches it is possible to access nsh without problems? I don't know if this is due to a rebase with the master, or my linker script... Thanks in advance.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1079700787


   @antmerlino I think that the best would check again the `STM32H747I-DISCO` base changes to match with the portenta port, unfortunately many things have been changed in NuttX during the time PR has been open.  Although a build with `nsh` is possible, the code is out of date with what was done in NuttX 😔 (please don't be discouraged, we are close!)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-1081812585


   @pkarashchenko @acassis I think this is good for merge ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] antmerlino commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
antmerlino commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-807912381


   @acassis Will do... I'm tied up with some other things at the moment but I'll clean it up in the coming week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 commented on pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
davids5 commented on pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#issuecomment-842334423


   @antmerlino CI fails looks like you need to rebase on master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r837517020



##########
File path: boards/arm/stm32h7/portenta-h7/include/board.h
##########
@@ -0,0 +1,368 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/include/board.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+#define __BOARDS_ARM_STM32H7_PORTENTA_INCLUDE_BOARD_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
+/* Do not include STM32 H7 header files here */
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Clocking *****************************************************************/
+
+/* The board provides the following clock sources:
+ *
+ *  NOTE: The documentation and schematics claim that there is a 27MHz
+ *  oscillator for HSE. However, after much headache, it was measured
+ *  to actually be 25MHz. Looking at some mbed code validates that they
+ *  are using 25MHz as the HSE clock. This was further confirmed with the
+ *  Arduino staff.
+ *
+ *   U18: 25MHz HSE MEMS Oscillator
+ *   Y1:  32768Hz LSE crystal oscillator
+ *
+ * So we have these clock source available within the STM32
+ *
+ *   HSI: 64 MHz RC factory-trimmed
+ *   LSI: 32 KHz RC
+ *   HSE: 27 MHz oscillator
+ *   LSE: 32.768 kHz
+ */
+
+#define STM32_HSI_FREQUENCY     16000000ul
+#define STM32_LSI_FREQUENCY     32000
+#define STM32_HSE_FREQUENCY     25000000ul
+#define STM32_LSE_FREQUENCY     32768
+
+#define STM32_BOARD_USEHSE
+#define STM32_HSEBYP_ENABLE
+
+/* Main PLL Configuration.
+ *
+ * PLL source is HSE = 25,000,000
+ *
+ * When STM32_HSE_FREQUENCY / PLLM <= 2MHz VCOL must be selected.
+ * VCOH otherwise.
+ *
+ * PLL_VCOx = (STM32_HSE_FREQUENCY / PLLM) * PLLN
+ * Subject to:
+ *
+ *     1 <= PLLM <= 63
+ *     4 <= PLLN <= 512
+ *   150 MHz <= PLL_VCOL <= 420MHz
+ *   192 MHz <= PLL_VCOH <= 836MHz
+ *
+ * SYSCLK  = PLL_VCO / PLLP
+ * CPUCLK  = SYSCLK / D1CPRE
+ * Subject to
+ *
+ *   PLLP1   = {2, 4, 6, 8, ..., 128}
+ *   PLLP2,3 = {2, 3, 4, ..., 128}
+ *   CPUCLK <= 480 MHz
+ */
+
+#define STM32_PLLCFG_PLLSRC      RCC_PLLCKSELR_PLLSRC_HSE
+
+/* PLL1, wide 2 - 4 MHz input, enable DIVP, DIVQ, DIVR
+ *
+ *   PLL1_VCO = (25,000,000 / 5) * 160 = 800 MHz
+ *
+ *   PLL1P = PLL1_VCO/2  = 960 MHz / 2   = 400 MHz
+ *   PLL1Q = PLL1_VCO/4  = 960 MHz / 4   = 200 MHz
+ *   PLL1R = PLL1_VCO/8  = 960 MHz / 8   = 100 MHz
+ */
+
+#define STM32_PLLCFG_PLL1CFG     (RCC_PLLCFGR_PLL1VCOSEL_WIDE | \
+                                  RCC_PLLCFGR_PLL1RGE_2_4_MHZ | \
+                                  RCC_PLLCFGR_DIVP1EN | \
+                                  RCC_PLLCFGR_DIVQ1EN | \
+                                  RCC_PLLCFGR_DIVR1EN)
+#define STM32_PLLCFG_PLL1M       RCC_PLLCKSELR_DIVM1(5)
+#define STM32_PLLCFG_PLL1N       RCC_PLL1DIVR_N1(160)
+#define STM32_PLLCFG_PLL1P       RCC_PLL1DIVR_P1(2)
+#define STM32_PLLCFG_PLL1Q       RCC_PLL1DIVR_Q1(4)
+#define STM32_PLLCFG_PLL1R       RCC_PLL1DIVR_R1(8)
+
+#define STM32_VCO1_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL1P_FREQUENCY    (STM32_VCO1_FREQUENCY / 2)
+#define STM32_PLL1Q_FREQUENCY    (STM32_VCO1_FREQUENCY / 4)
+#define STM32_PLL1R_FREQUENCY    (STM32_VCO1_FREQUENCY / 8)
+
+/* PLL2 */
+
+#define STM32_PLLCFG_PLL2CFG (RCC_PLLCFGR_PLL2VCOSEL_WIDE | \
+                              RCC_PLLCFGR_PLL2RGE_2_4_MHZ | \
+                              RCC_PLLCFGR_DIVP2EN)
+#define STM32_PLLCFG_PLL2M       RCC_PLLCKSELR_DIVM2(5)
+#define STM32_PLLCFG_PLL2N       RCC_PLL2DIVR_N2(160)
+#define STM32_PLLCFG_PLL2P       RCC_PLL2DIVR_P2(2)
+#define STM32_PLLCFG_PLL2Q       RCC_PLL2DIVR_Q2(4)
+#define STM32_PLLCFG_PLL2R       RCC_PLL2DIVR_R2(8)
+
+#define STM32_VCO2_FREQUENCY     ((STM32_HSE_FREQUENCY / 5) * 160)
+#define STM32_PLL2P_FREQUENCY    (STM32_VCO2_FREQUENCY / 2)
+#define STM32_PLL2Q_FREQUENCY    (STM32_VCO2_FREQUENCY / 4)
+#define STM32_PLL2R_FREQUENCY    (STM32_VCO2_FREQUENCY / 8)
+
+/* PLL3 */
+
+#define STM32_PLLCFG_PLL3CFG 0
+#define STM32_PLLCFG_PLL3M   0
+#define STM32_PLLCFG_PLL3N   0
+#define STM32_PLLCFG_PLL3P   0
+#define STM32_PLLCFG_PLL3Q   0
+#define STM32_PLLCFG_PLL3R   0
+
+#define STM32_VCO3_FREQUENCY
+#define STM32_PLL3P_FREQUENCY
+#define STM32_PLL3Q_FREQUENCY
+#define STM32_PLL3R_FREQUENCY

Review comment:
       @pkarashchenko the port here was based on the same code of the `STM32H747I-DISCO`, so @antmerlino is following the same from here: https://github.com/apache/incubator-nuttx/blob/d09be7d65836f8aa4cfb3fd4b9d792113741b15e/boards/arm/stm32h7/stm32h747i-disco/include/board.h#L139




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] microhobby commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
microhobby commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r835715200



##########
File path: boards/arm/stm32h7/portenta-h7/configs/nsh/defconfig
##########
@@ -0,0 +1,54 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_NSH_DISABLE_IFCONFIG is not set
+# CONFIG_NSH_DISABLE_PS is not set
+# CONFIG_STANDARD_SERIAL is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="portenta-h7"
+CONFIG_ARCH_BOARD_PORTENTA_H7=y
+CONFIG_ARCH_CHIP="stm32h7"
+CONFIG_ARCH_CHIP_STM32H747XI=y
+CONFIG_ARCH_CHIP_STM32H7=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARMV7M_DCACHE=y
+CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
+CONFIG_ARMV7M_DTCM=y
+CONFIG_ARMV7M_ICACHE=y
+CONFIG_BOARD_LOOPSPERMSEC=43103
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_INTELHEX_BINARY=y
+CONFIG_MAX_TASKS=16
+CONFIG_MM_REGIONS=4
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILEIOSIZE=512
+CONFIG_NSH_LINELEN=64
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_RAM_SIZE=245760
+CONFIG_RAM_START=0x20010000
+CONFIG_RAW_BINARY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_WAITPID=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SPI=y
+CONFIG_START_DAY=6
+CONFIG_START_MONTH=12
+CONFIG_START_YEAR=2011
+CONFIG_STM32H7_CUSTOM_CLOCKCONFIG=y
+CONFIG_STM32H7_USART1=y
+CONFIG_SYSLOG_CONSOLE=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_TASK_NAME_SIZE=0
+CONFIG_USART1_SERIAL_CONSOLE=y
+CONFIG_USER_ENTRYPOINT="nsh_main"

Review comment:
       change it to `CONFIG_INIT_ENTRYPOINT="nsh_main"`

##########
File path: boards/arm/stm32h7/portenta-h7/src/Makefile
##########
@@ -0,0 +1,63 @@
+############################################################################
+# boards/arm/stm32h7/portenta-h7/src/Makefile
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(TOPDIR)/Make.defs
+
+CSRCS = stm32_boot.c stm32_bringup.c
+
+ifeq ($(CONFIG_STM32H7_CUSTOM_CLOCKCONFIG),y)
+CSRCS += stm32_clockconfig.c
+endif
+
+ifeq ($(CONFIG_BOARDCTL_RESET),y)
+CSRCS += stm32_reset.c
+endif
+
+ifeq ($(CONFIG_ARCH_LEDS),y)
+CSRCS += stm32_autoleds.c
+else
+CSRCS += stm32_userleds.c
+endif
+
+ifeq ($(CONFIG_STM32H7_SPI),y)
+CSRCS += stm32_spi.c
+endif
+
+ifeq ($(CONFIG_STM32H7_OTGHS),y)
+CSRCS += stm32_usb.c
+endif
+
+ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y)
+CSRCS += stm32_uid.c
+endif
+
+ifeq ($(CONFIG_LIB_BOARDCTL),y)

Review comment:
       Change it to `ifeq ($(CONFIG_BOARDCTL),y)`

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/Make.defs
##########
@@ -0,0 +1,63 @@
+############################################################################
+# boards/arm/stm32h7/portenta-h7/scripts/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+include $(TOPDIR)/.config
+include $(TOPDIR)/tools/Config.mk
+include $(TOPDIR)/arch/arm/src/armv7-m/Toolchain.defs
+
+LDSCRIPT = flash.ld
+
+ifeq ($(CONFIG_CYGWIN_WINTOOL),y)

Review comment:
       This need to be removed. Check: https://github.com/apache/incubator-nuttx/commit/8defb843aa2e1d49b08b1cb7155aea97e1721b6c
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #3172: Adds bare bones Arduino Portenta H7 port which is mostly a copy of STM32H747I-DISCO port.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #3172:
URL: https://github.com/apache/incubator-nuttx/pull/3172#discussion_r607169880



##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
##########
@@ -0,0 +1,330 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_usb.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_usb.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Mateusz Szafoni <ra...@railab.me>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_bringup.c
##########
@@ -0,0 +1,243 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_bringup.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_bringup.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_userleds.c
##########
@@ -0,0 +1,151 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_userleds.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_userleds.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/portenta-h7.h
##########
@@ -0,0 +1,177 @@
+/****************************************************************************
+ * boards/arm/stm32h7/stm32h747i-disco/src/portenta-h7.h
+ *
+#   Copyright (C) 2017, 2019 Gwenhael Goavec-Merou. All rights reserved.
+#   Authors: Gwenhael Goavec-Merou<gw...@trabucayre.com>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/flash.ld
##########
@@ -0,0 +1,210 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/flash.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/flash.ld
+ *
+ *   Copyright (C) 2018 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/user-space.ld
##########
@@ -0,0 +1,117 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/user-space.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/user-space.ld
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_autoleds.c
##########
@@ -0,0 +1,192 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_autoleds.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_autoleds.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Authors: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_boot.c
##########
@@ -0,0 +1,115 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta/src/stm32_boot.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_boot.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/memory.ld
##########
@@ -0,0 +1,71 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/memory.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/memory.ld
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
##########
@@ -0,0 +1,231 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_adc.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_adc.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Authors: Gregory Nutt <gn...@nuttx.org>
+ *            David Sidrane <da...@nscdg.com>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
##########
@@ -0,0 +1,136 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/kernel/stm32_userspace.c
+ *
+ * Copied from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/kernel/stm32_userspace.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/scripts/kernel.space.ld
##########
@@ -0,0 +1,122 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/scripts/kernel-space.ld
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/scripts/kernel-space.ld
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Author: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_spi.c
##########
@@ -0,0 +1,272 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_spi.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_spi.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Authors: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license

##########
File path: boards/arm/stm32h7/portenta-h7/src/stm32_appinitialize.c
##########
@@ -0,0 +1,98 @@
+/****************************************************************************
+ * boards/arm/stm32h7/portenta-h7/src/stm32_appinitialize.c
+ *
+ * Modified from:
+ *
+ * boards/arm/stm32h7/stm32h747i-disco/src/stm32_appinitialize.c
+ *
+ *   Copyright (C) 2019 Gregory Nutt. All rights reserved.
+ *   Authors: Gregory Nutt <gn...@nuttx.org>

Review comment:
       could change to apache license




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org