Skip to content

gpio for nuttx #276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

chunseoklee
Copy link
Contributor

IoT.js-DCO-1.0-Signed-off-by: Chunseok Lee [email protected]

@chunseoklee
Copy link
Contributor Author

This patch does not work now since dns module is not supported by nuttx. I will reopen this patch after dns module is fixed.

@seanshpark
Copy link
Contributor

Using with latest nuttx and libtuv build is ok.

  1. use latest nuttx as described in Build-for-Nuttx-(new) page
  2. use libtuv with --tuv option in build.py

@seanshpark seanshpark reopened this Oct 29, 2015
@seanshpark
Copy link
Contributor

As there are long code definitions from nuttx/arch/arm/src/stm32/stm32_gpio.h file, I was thinking about removing them and include that particular file.

#include "../arch/arm/src/stm32/stm32_gpio.h"

This didn't work cause arch/arm/src/stm32/chip/stm32f40xxx_pinmap.h was including "stm32_gpio.h" and there is no given include search path.

So thought why not give include paths in the make file.

diff --git a/cmake/config.cmake b/cmake/config.cmake
index b29e519..e06daf9 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -32,6 +32,13 @@ elseif(${CFG_SYS_NAME} STREQUAL "external")
   endif()
 endif()

+if ("${PLATFORM_DESCRIPT}" STREQUAL "arm-nuttx")
+  set(TARGET_INC ${TARGET_INC} "${NUTTX_HOME}")
+  if ("${TARGET_BOARD}" STREQUAL "stm32f4disco")
+    set(TARGET_INC ${TARGET_INC} "${NUTTX_HOME}/arch/arm/src/stm32")
+  endif()
+endif()
+
 set(CC ${CMAKE_C_COMPILER})
 set(CXX ${CMAKE_CXX_COMPILER})

and change the include line like this

#include "stm32_gpio.h"

But again, when other boards should be included we may have to add (some or lots of) #if defined(...) #elif defined(...).

So what do you and maybe others think about this?

@chunseoklee
Copy link
Contributor Author

@seanshpark updated as commented

@seanshpark
Copy link
Contributor

@chunseoklee thank you. one more thing. it's about gpioPin[5], I can't see index limit check and I think there are more pins than 4, so, have any plans about this?

@chunseoklee
Copy link
Contributor Author

@seanshpark no special reason for that. I added 6 gpios to PR. Now, 10 gpios are available for nuttx-STM32.

@seanshpark
Copy link
Contributor

OK, LGTM

@ILyoan
Copy link
Contributor

ILyoan commented Nov 4, 2015

@chunseoklee It looks like, we need more descriptor to help distinguishing among various boards.
Since this patch seems to work only for STM32F4 board. so I think "iotjs_module_gpio-arm-nuttx-stm32f4dis.cpp" would be better name.
As we are remaking build.py and it will have target-board descriptor, Let's take look at the naming policy after build system landed.

10 gpios from PA8 to PC3 on default

IoT.js-DCO-1.0-Signed-off-by: Chunseok Lee [email protected]
@chunseoklee
Copy link
Contributor Author

This patch suspended due to low priority

@yichoi yichoi added the API label Oct 20, 2016
pmarcinkiew pushed a commit to pmarcinkiew/iotjs that referenced this pull request Aug 29, 2017
…tdown_removed_from_libc

dummy shutdown removed from built-in libc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants