Picon

sam34/sam_lowputc

Hi Greg,


I stumbled across some strange code in sam34/sam_lowputc, which causes weird behavior and doesn't make any sense to me:


 for (;;)
    {
      /* Wait for the transmitter to be available */

      while ((getreg32(SAM_CONSOLE_BASE + SAM_UART_SR_OFFSET) &
        UART_INT_TXEMPTY) == 0);

      /* Disable interrupts so that the test and the transmission are
       * atomic.
       */

      flags = irqsave();
    &n bsp; if ((getreg32(SAM_CONSOLE_BASE + SAM_UART_SR_OFFSET) &
        UART_INT_TXEMPTY) != 0)
        {
          /* Send the character */

          putreg32((uint32_t)ch, SAM_CONSOLE_BASE + SAM_UART_THR_OFFSET);
        }

      irqrestore(flags);
    }


What is the purpose of the for (;;) around the code? If I enable DEBUG features I get stuck at  

showprogress('A'); in sam_start() meaning that repeated 'A's are printed to the console. Afte r looking at the code, this is expected but doesn't make sense to me. After removing the for(;;) my code runs fine, except that now showprogress doesn't print the 'A' at all (the following characters for the other 'showprogress' are printed correctly).


I quickly checked with stm32_lowputc and others, and there I couldn't find a for(;;), which is what I expected.


Max




__._,_.___
Posted by: max.kriegleder-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

Patches for uio, utsname and gethostname [1 Attachment]

<*>[Attachment(s) from SP included below]

Hi Greg,

I've had this patches sitting on my machine for a while and it is a
shame. Plus they caused me some trouble to extract from my old repos to
merge in the new one. And I have more to do.

They are work in progress but I've more time to develop them, so if you
can, accept them upstream and I'll continue with patches.

PS: Do you still prefer patches via mail?

-- 
	SP

<*>Attachment(s) from SP:

<*> 1 of 1 File(s)
https://groups.yahoo.com/neo/groups/nuttx/attachments/1261541288;_ylc=X3oDMTJyYWphM2tyBF9TAzk3MzU5NzE0BGdycElkAzIzMzg5MDcwBGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0MzU5MjM5OTk- 
  <*> nuttx-utsname-gethostname.patch

------------------------------------
Posted by: SP <sp@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

Framework on NUTTX

Hi Greg,


Has any framework been tried porting on NUTTX ?


Is there any kind of webkit available or web framework which can be ported on NUTTX ?


I am looking to port a web kind of framework on top of NUTTX. So, Do u have any kind of information/suggestion/direction for that.


Thanx 




__._,_.___
Posted by: rohitsaraf733-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

Callback to a GPIO interrupt on SAM

Hi Greg,

I am still struggling with porting code from a previous stm32 chip to a sam chip. On the stm32 I have a callback that as triggered on a GPIO interrupt, which is set through

xcpt_t stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge, bool event, xcpt_t func)

I want the same behavior on the sam chip, but I cannot find equivalent code in sam_gpioirq.c. Am I looking at the wrong place or does something like this simply not exist yet? If it doesn't what at all happens on the sam if an interrupt is triggered? I mean there should be somehow user code attached to the ISR, correct?

Max




__._,_.___
Posted by: max.kriegleder-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

Cloning configurations

So what is the recommended way for someone to get the configurations
now? If it is just to clone the whole repo or manually get the files?

If yes, why not have a branch per board or something?

-- 
	SP

------------------------------------
Posted by: SP <sp@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

CAN Receive on the STM32F4Discovery cause Assertion failure sem_post.c

I'm developing a GPRS system that is using CAN to get data from a battery management system (BMS) and I'm facing an important issue with the CAN communication functions.

Here is the context, when I'm using the CAN bus to transmit good amount of data, I don't have any issue. The assertion failed at file:semaphore/sem_post.c line: 120 only happen after a while when I'm receive a large amount of data. By example, I'm updating the firmware of the BMS using CAN. It's working well until it reach 97% of the transfer done. Every CAN packet sent to the BMS is read back to validate the content. The other situation is when I'm only receiving BMS data without sending anything, this failure happens too.    

Here is th e stack dump if that can help:

up_assert: Assertion failed at file:semaphore/sem_post.c line: 120

up_dumpstate: sp:         20002bf8

up_dumpstate: stack base: 20002d6c

up_dumpstate: stack size: 00000400

up_dumpstate: stack used: 00000000

up_stackdump: 20002be0: 20002d6c 20002bf8 20002be0 20002be0 20002bf8 00000000 00000000 00000000

up_stackdump: 20002c00: 20002c08 08001ca5 20002bf8 2000129c 00000400 20002d6c 20002c28 08001d45

up_stackdump: 20002c20: 00000078 20002c28 00000078 0802fb48 20002c38 08003833 01640000 20000e8e

up_stackdump: 20002c40: 20002ca4 00010001 ffffffff 00000000 20002c58 0802ef8f 20002c60 20002ca4

up_stackdump: 20002c60: 20002ca4 20000db0 08017541 00000000 20000f7c 20000e8e 00000008 fffffff4

up_stackdump: 20002c80: 00000000 20000f62 20002c90 0802beab 20002cf8 00000024 0000000c 47f9f99c

up_stackdump: 20002ca0: b30edacf 18add1a3 20002ca8 20002cb0 00000001 b30edacf 20000da0 20000db0

up_stackdump: 20002cc0: 20002cc8 08002f41 20002cf8 00000024 100010ec 0802bd95 20002ce0 08001617

up_stackdump: 20002ce0: 20002cf8 00000024 00000000 00000000 20002d44 0800047f 20002d40 00000000

up_stackdump: 20002d00: 00000000 00000000 00000000 20002d44 00000000 00000000 00000000 00000000

up_stackdump: 20002d20: 00000000 20001318 10001d1c 00000000 00000000 08002de7 08009cc8 61000200

up_stackdump: 20002d40: 20002d44 deadbeef 0001d290 20002d70 00000010 20002d5c 00000000 deadbeef

up_stackdump: 20002d60: deadbeef deadbeef deadbeef deadbeef 00000008 80000000 00000190 80000008

up_registerdump: R0: 00000000 20001318 10001d1c 00000000 00000000 00000000 00000000 20002d44

up_registerdump: R8: 00000000 00000000 00000000 00000000 00000000 20002d40 08002de7 08009cc8

up_registerdump: xPSR: 61000200 PRIMASK: 00000000 CONTROL: 00000000

up_taskdump: PID: 0 Stack Used=0 of 0

up_taskdump: PID: 1 Stack Used=536 of 2020

up_taskdump: PID: 2 Stack Used=560 of 2020

up_taskdump: PID: 3 Stack Used=1224 of 2020

up_taskdump: PID: 4 Stack Used=688 of 996

up_taskdump: PID: 6 Stack Used=1200 of 8196


Based on the stack dump, the call has been done at the address 0x08009CC8 that is corresponding to the idle function. 


The CAN is open with the flag O_NONBLOCK and if I follow the code in can.c and in stm32_can.c, with that flag, no semaphore sem_post functions are hit on the CAN read side. So I just can't see why. I may missed something.


Thanks for your help.


Cheer s,


Pat




__._,_.___
Posted by: codenivore-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

bug in drivers/input/stmpe811_base.c deallocation

Hello

I'm using the stmpe811 driver as a template for i2c init of my pca9555 driver...

I found that, in stmpe811_instanciate(),  when CONFIG_STMPE811_MULTIPLE is
enabled, and the call to stmpe811_checkid() fails, then the linked device list
is not restored to its previous state.

Do you think that more drivers could have this bug?

BR

diff --git a/drivers/input/stmpe811_base.c b/drivers/input/stmpe811_base.c
index 0bdbbf2..f2bdf8b 100644
--- a/drivers/input/stmpe811_base.c
+++ b/drivers/input/stmpe811_base.c
 <at>  <at>  -339,6 +339,7  <at>  <at>  STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
   if (ret < 0)
     {
 #ifdef CONFIG_STMPE811_MULTIPLE
+      g_stmpe811list = priv->flink;
       kmm_free(priv);
 #endif
       return NULL;

-- 
S├ębastien Lorquet

------------------------------------
Posted by: Sebastien Lorquet <sebastien@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

IO expander drivers

Hello Greg, and others,

I have to support a NXP PCA9555 I2C IO expander on our board. I can access the
i2c bus directly from the app, but i dont like that.

I would prefer write a generic GPIO device driver.

My idea is to register a char driver /dev/gpioi2c0

Then access the gpio set via some IOCTLs

-count the number of line
-get line config (can be input, output, drivers can be set to PP,OD, etc)
-read line
-write line

READ/WRITE/SEEK can be used to represent the gpio block as an array of bytes
with fixed length.

As an alternative, IOCTLs can be used for this, too.

Could you recommend an API to handle this? I will stick to your preferences,
since I dont have any.

Such generic drivers could live in drivers/gpio, and in arch/ for platform
specific GPIOs *not used by peripherals*, such as MCU IO ports.

While waiting for your advice, I will start writing some code to initialize the
pca device.

-- 
S├ębastien Lorquet

------------------------------------
Posted by: Sebastien Lorquet <sebastien@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

[PATCH] pthread_create: on error-path clear group after just binding before destroying tcb [1 Attachment]

<*>[Attachment(s) from Jussi Kivilinna included below]

Group binding needs to be cleared before sched_releasetcb(), as otherwise
group_leave() will be called and group->tg_nmembers decremented or group
being released. group_leave() should be called only after group_join()
is called, not after group_bind().

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@...>
---
 nuttx/sched/pthread/pthread_create.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/nuttx/sched/pthread/pthread_create.c b/nuttx/sched/pthread/pthread_create.c
index 8cfab59..ae9db19 100644
--- a/nuttx/sched/pthread/pthread_create.c
+++ b/nuttx/sched/pthread/pthread_create.c
 <at>  <at>  -241,6 +241,9  <at>  <at>  int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
   int errcode;
   pid_t pid;
   int ret;
+#ifdef HAVE_TASK_GROUP
+  bool group_joined = false;
+#endif

   /* If attributes were not supplied, use the default attributes */

 <at>  <at>  -368,6 +371,8  <at>  <at>  int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
       errcode = ENOMEM;
       goto errout_with_join;
     }
+
+  group_joined = true;
 #endif

   /* Attach the join info to the TCB. */
 <at>  <at>  -451,6 +456,13  <at>  <at>  errout_with_join:
   ptcb->joininfo = NULL;

 errout_with_tcb:
+#ifdef HAVE_TASK_GROUP
+  /* Clear group binding */
+  if (ptcb && !group_joined)
+    {
+      ptcb->cmn.group = NULL;
+    }
+#endif
   sched_releasetcb((FAR struct tcb_s *)ptcb, TCB_FLAG_TTYPE_PTHREAD);
   return errcode;
 }

---
 nuttx/sched/pthread/pthread_create.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

<*>Attachment(s) from Jussi Kivilinna:

<*> 1 of 1 File(s)
https://groups.yahoo.com/neo/groups/nuttx/attachments/928129223;_ylc=X3oDMTJybTJyYnBtBF9TAzk3MzU5NzE0BGdycElkAzIzMzg5MDcwBGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0MzU3MzM2NTk- 
  <*> pthread_create-on-error-path.patch

------------------------------------
Posted by: Jussi Kivilinna <jussi.kivilinna@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

Nuttx STM32F102 Support

Hello to all!


I am going to develop a board that uses this ST Microcontroller, the STM32F102. On support I found that it supports the architecture, but no boards. What do you mean with this?


I only pretend to use the top-level functions from the RTOS with this uC. What am I missing?


Best regards,


Pedro



__._,_.___
Posted by: pedro.adroque-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

Move to Bitbucket.org

The NuttX GIT repository is moving to Bitbucket.org:


https://bitbucket.org/patacongo/nuttx


I may shadow some changes on SourceForge for a few days, but you should think of the SourceForge GIT repository as obsoleted.


Greg




__._,_.___
Posted by: spudarnia-/E1597aS9LQAvxtiuMwx3w@public.gmane.org



__,_._,___

Gmane