TODO 123 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441
  1. NuttX TODO List (Last updated August 22, 2017)
  2. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3. This file summarizes known NuttX bugs, limitations, inconsistencies with
  4. standards, things that could be improved, and ideas for enhancements. This
  5. TODO list does not include issues associated with individual boar ports. See
  6. also the individual README.txt files in the configs/ sub-directories for
  7. issues related to each board port.
  8. nuttx/:
  9. (12) Task/Scheduler (sched/)
  10. (1) SMP
  11. (1) Memory Management (mm/)
  12. (0) Power Management (drivers/pm)
  13. (3) Signals (sched/signal, arch/)
  14. (4) pthreads (sched/pthread)
  15. (0) Message Queues (sched/mqueue)
  16. (8) Kernel/Protected Build
  17. (3) C++ Support
  18. (6) Binary loaders (binfmt/)
  19. (16) Network (net/, drivers/net)
  20. (4) USB (drivers/usbdev, drivers/usbhost)
  21. (0) Other drivers (drivers/)
  22. (13) Libraries (libc/, libm/)
  23. (10) File system/Generic drivers (fs/, drivers/)
  24. (10) Graphics Subsystem (graphics/)
  25. (2) Build system / Toolchains
  26. (3) Linux/Cywgin simulation (arch/sim)
  27. (4) ARM (arch/arm/)
  28. apps/ and other Add-Ons:
  29. (2) Network Utilities (apps/netutils/)
  30. (1) NuttShell (NSH) (apps/nshlib)
  31. (1) System libraries apps/system (apps/system)
  32. (1) Modbus (apps/modbus)
  33. (1) Pascal add-on (pcode/)
  34. (4) Other Applications & Tests (apps/examples/)
  35. o Task/Scheduler (sched/)
  36. ^^^^^^^^^^^^^^^^^^^^^^^
  37. Title: CHILD PTHREAD TERMINATION
  38. Description: When a tasks exits, shouldn't all of its child pthreads also be
  39. terminated?
  40. Status: Closed. No, this behavior will not be implemented.
  41. Priority: Medium, required for good emulation of process/pthread model.
  42. The current behavior allows for the main thread of a task to
  43. exit() and any child pthreads will perist. That does raise
  44. some issues: The main thread is treated much like just-another-
  45. pthread but must follow the semantics of a task or a process.
  46. That results in some inconsistencies (for example, with robust
  47. mutexes, what should happen if the main thread exits while
  48. holding a mutex?)
  49. Title: pause() NON-COMPLIANCE
  50. Description: In the POSIX description of this function the pause() function
  51. must suspend the calling thread until delivery of a signal whose
  52. action is either to execute a signal-catching function or to
  53. terminate the process. The current implementation only waits for
  54. any non-blocked signal to be received. It should only wake up if
  55. the signal is delivered to a handler.
  56. Status: Open.
  57. Priority: Medium Low.
  58. Title: ON-DEMAND PAGING INCOMPLETE
  59. Description: On-demand paging has recently been incorporated into the RTOS.
  60. The design of this feature is described here:
  61. http://www.nuttx.org/NuttXDemandPaging.html.
  62. As of this writing, the basic feature implementation is
  63. complete and much of the logic has been verified. The test
  64. harness for the feature exists only for the NXP LPC3131 (see
  65. configs/ea3131/pgnsh and locked directories). There are
  66. some limitations of this testing so I still cannot say that
  67. the feature is fully functional.
  68. Status: Open. This has been put on the shelf for some time.
  69. Priority: Medium-Low
  70. Title: GET_ENVIRON_PTR()
  71. Description: get_environ_ptr() (sched/sched_getenvironptr.c) is not implemented.
  72. The representation of the environment strings selected for
  73. NuttX is not compatible with the operation. Some significant
  74. re-design would be required to implement this function and that
  75. effort is thought to be not worth the result.
  76. Status: Open. No change is planned.
  77. Priority: Low -- There is no plan to implement this.
  78. Title: TIMER_GETOVERRUN()
  79. Description: timer_getoverrun() (sched/timer_getoverrun.c) is not implemented.
  80. Status: Open
  81. Priority: Low -- There is no plan to implement this.
  82. Title: INCOMPATIBILITIES WITH execv() AND execl()
  83. Description: Simplified 'execl()' and 'execv()' functions are provided by
  84. NuttX. NuttX does not support processes and hence the concept
  85. of overlaying a tasks process image with a new process image
  86. does not make any sense. In NuttX, these functions are
  87. wrapper functions that:
  88. 1. Call the non-standard binfmt function 'exec', and then
  89. 2. exit(0).
  90. As a result, the current implementations of 'execl()' and
  91. 'execv()' suffer from some incompatibilities, the most
  92. serious of these is that the exec'ed task will not have
  93. the same task ID as the vfork'ed function. So the parent
  94. function cannot know the ID of the exec'ed task.
  95. Status: Open
  96. Priority: Medium Low for now
  97. Title: ISSUES WITH atexit(), on_exit(), AND pthread_cleanup_pop()
  98. Description: These functions execute with the following bad properties:
  99. 1. They run with interrupts disabled,
  100. 2. They run in supervisor mode (if applicable), and
  101. 3. They do not obey any setup of PIC or address
  102. environments. Do they need to?
  103. 4. In the case of task_delete() and pthread_cancel() without
  104. defferred cancellation, these callbacks will run on the
  105. thread of execution and address context of the caller of
  106. task_delete() or pthread_cancel(). That is very bad!
  107. The fix for all of these issues it to have the callbacks
  108. run on the caller's thread as is currently done with
  109. signal handlers. Signals are delivered differently in
  110. PROTECTED and KERNEL modes: The deliver is involes a
  111. signal handling trampoline function in the user address
  112. space and two signal handlers: One to call the signal
  113. handler trampoline in user mode (SYS_signal_handler) and
  114. on in with the signal handler trampoline to return to
  115. supervisor mode (SYS_signal_handler_return)
  116. The primary difference is in the location of the signal
  117. handling trampoline:
  118. - In PROTECTED mode, there is on a single user space blob
  119. with a header at the beginning of the block (at a well-
  120. known location. There is a pointer to the signal handler
  121. trampoline function in that header.
  122. - In the KERNEL mode, a special process signal handler
  123. trampoline is used at a well-known location in every
  124. process address space (ARCH_DATA_RESERVE->ar_sigtramp).
  125. Status: Open
  126. Priority: Medium Low. This is an important change to some less
  127. important interfaces. For the average user, these
  128. functions are just fine the way they are.
  129. Title: execv() AND vfork()
  130. Description: There is a problem when vfork() calls execv() (or execl()) to
  131. start a new application: When the parent thread calls vfork()
  132. it receives and gets the pid of the vforked task, and *not*
  133. the pid of the desired execv'ed application.
  134. The same tasking arrangement is used by the standard function
  135. posix_spawn(). However, posix_spawn uses the non-standard, internal
  136. NuttX interface task_reparent() to replace the child's parent task
  137. with the caller of posix_spawn(). That cannot be done with vfork()
  138. because we don't know what vfork() is going to do.
  139. Any solution to this is either very difficult or impossible without
  140. an MMU.
  141. Status: Open
  142. Priority: Low (it might as well be low since it isn't going to be fixed).
  143. Title: errno IS NOT SHARED AMONG THREADS
  144. Description: In NuttX, the errno value is unique for each thread. But for
  145. bug-for-bug compatibility, the same errno should be shared by
  146. the task and each thread that it creates. It is *very* easy
  147. to make this change: Just move the pterrno field from
  148. struct tcb_s to struct task_group_s. However, I am still not
  149. sure if this should be done or not.
  150. Status: Closed. The existing solution is better (although its
  151. incompatibilities could show up in porting some code).
  152. Priority: Low
  153. Title: SCALABILITY
  154. Description: Task control information is retained in simple lists. This
  155. is completely appropriate for small embedded systems where
  156. the number of tasks, N, is relatively small. Most list
  157. operations are O(N). This could become an issue if N gets
  158. very large.
  159. In that case, these simple lists should be replaced with
  160. something more performant such as a balanced tree in the
  161. case of ordered lists. Fortunately, most internal lists are
  162. hidden behind simple accessor functions and so the internal
  163. data structures can be changed if need with very little impact.
  164. Explicitly reference to the list structure are hidden behind
  165. the macro this_task().
  166. Status: Open
  167. Priority: Low. Things are just the way that we want them for the way
  168. that NuttX is used today.
  169. Title: INTERNAL VERSIONS OF USER FUNCTIONS
  170. Description: The internal NuttX logic uses the same interfaces as does
  171. the application. That sometime produces a problem because
  172. there is "overloaded" functionality in those user interfaces
  173. that are not desireable.
  174. For example, having cancellation points hidden inside of the
  175. OS can cause non-cancellation point interfaces to behave
  176. strangely. There was a change recently in pthread_cond_wait()
  177. and pthread_cond_timedwait() recently to effectively disable
  178. the cancellation point behavior of sem_wait(). This was
  179. accomplished with two functions: pthread_disable_cancel()
  180. and pthread_enable_cancel()
  181. Here is another issue:  Internal OS functions should not set
  182. errno and should never have to look at the errno value to
  183. determine the cause of the failure.  The errno is provided
  184. for compatibility with POSIX application interface
  185. requirements and really doesn't need to be used within the
  186. OS.
  187. Both of these could be fixed if there were special internal
  188. versions these functions.  For example, there could be a an
  189. nx_sem_wait() that does all of the same things as sem_wait()
  190. was does not create a cancellation point and does not set
  191. the errno value on failures.
  192. Everything inside the OS would use nx_sem_wait().
  193. Applications would call sem_wait() which would just be a
  194. wrapper around nx_sem_wait() that adds the cancellation point
  195. and that sets the errno value on failures.
  196. Changes like that could clean up some of this internal
  197. craziness.  The condition variable change described above is
  198. really a "bandaid" to handle the case that sem_wait() is a
  199. cancellation point.
  200. Status: Open
  201. Priority: Low. Things are working OK the way they are. But the design
  202. could be improved and made a little more efficient with this
  203. change.
  204. Task: IDLE THREAD TCB SETUP
  205. Description: There are issues with setting IDLE thread stacks:
  206. 1. One problem is stack-related data in the IDLE threads TCB.
  207. A solution might be to standardize the use of g_idle_topstack.
  208. That you could add initialization like this in os_start:
  209. @@ -344,6 +347,11 @@ void os_start(void)
  210. g_idleargv[1] = NULL;
  211. g_idletcb.argv = g_idleargv;
  212. + /* Set the IDLE task stack size */
  213. +
  214. + g_idletcb.cmn.adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
  215. + g_idletcb.cmn.stack_alloc_ptr = (void *)(g_idle_topstack - CONFIG_IDLETHREAD_STACKSIZE);
  216. +
  217. /* Then add the idle task's TCB to the head of the ready to run list */
  218. dq_addfirst((FAR dq_entry_t *)&g_idletcb, (FAR dq_queue_t *)&g_readytorun);
  219. The g_idle_topstack variable is available for almost all architectures:
  220. $ find . -name *.h | xargs grep g_idle_top
  221. ./arm/src/common/up_internal.h:EXTERN const uint32_t g_idle_topstack;
  222. ./avr/src/avr/avr.h:extern uint16_t g_idle_topstack;
  223. ./avr/src/avr32/avr32.h:extern uint32_t g_idle_topstack;
  224. ./hc/src/common/up_internal.h:extern uint16_t g_idle_topstack;
  225. ./mips/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  226. ./misoc/src/lm32/lm32.h:extern uint32_t g_idle_topstack;
  227. ./renesas/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  228. ./renesas/src/m16c/chip.h:extern uint32_t g_idle_topstack; /* Start of the heap */
  229. ./risc-v/src/common/up_internal.h:EXTERN uint32_t g_idle_topstack;
  230. ./x86/src/common/up_internal.h:extern uint32_t g_idle_topstack;
  231. That omits there architectures: sh1, sim, xtensa, z16, z80,
  232. ez80, and z8. All would have to support this common
  233. globlal variable.
  234. Also, the stack itself may be 8-, 16-, or 32-bits wide,
  235. depending upon the architecture.
  236. 2. Another problem is colorizing that stack to use with
  237. stack usage monitoring logic. There is logic in some
  238. start functions to do this in a function called go_os_start.
  239. It is available in these architectures:
  240. ./arm/src/efm32/efm32_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  241. ./arm/src/kinetis/kinetis_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  242. ./arm/src/sam34/sam_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  243. ./arm/src/samv7/sam_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  244. ./arm/src/stm32/stm32_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  245. ./arm/src/stm32f7/stm32_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  246. ./arm/src/stm32l4/stm32l4_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  247. ./arm/src/tms570/tms570_boot.c:static void go_os_start(void *pv, unsigned int nbytes)
  248. ./arm/src/xmc4/xmc4_start.c:static void go_os_start(void *pv, unsigned int nbytes)
  249. But no others.
  250. Status: Open
  251. Priority: Low, only needed for more complete debug.
  252. o SMP
  253. ^^^
  254. Title: SMP AND DATA CACHES
  255. Description: When spinlocks, semaphores, etc. are used in an SMP system with
  256. a data cache, then there may be problems with cache coherency
  257. in some CPU architectures: When one CPU modifies the shared
  258. object, the changes may not be visible to another CPU if it
  259. does not share the data cache. That would cause failure in
  260. the IPC logic.
  261. Flushing the D-cache on writes and invalidating before a read is
  262. not really an option. That would essentially effect every memory
  263. access and there may be side-effects due to cache line sizes
  264. and alignment.
  265. For the same reason a separate, non-cacheable memory region is
  266. not an option. Essentially all data would have to go in the
  267. non-cached region and you would have no benefit from the data
  268. cache.
  269. On ARM Cortex-A, each CPU has a separate data cache. However,
  270. the MPCore's Snoop Controller Unit supports coherency among
  271. the different caches. The SCU is enabled by the SCU control
  272. register and each CPU participates in the SMP coherency by
  273. setting the ACTLR_SMP bit in the auxiliary control register
  274. (ACTLR).
  275. Status: Closed
  276. Priority: High on platforms that may have the issue.
  277. o Memory Management (mm/)
  278. ^^^^^^^^^^^^^^^^^^^^^^^
  279. Title: FREE MEMORY ON TASK EXIT
  280. Description: Add an option to free all memory allocated by a task when the
  281. task exits. This is probably not be worth the overhead for a
  282. deeply embedded system.
  283. There would be complexities with this implementation as well
  284. because often one task allocates memory and then passes the
  285. memory to another: The task that "owns" the memory may not
  286. be the same as the task that allocated the memory.
  287. Update. From the NuttX forum:
  288. ...there is a good reason why task A should never delete task B.
  289. That is because you will strand memory resources. Another feature
  290. lacking in most flat address space RTOSs is automatic memory
  291. clean-up when a task exits.
  292. That behavior just comes for free in a process-based OS like Linux:
  293. Each process has its own heap and when you tear down the process
  294. environment, you naturally destroy the heap too.
  295. But RTOSs have only a single, shared heap. I have spent some time
  296. thinking about how you could clean up memory required by a task
  297. when a task exits. It is not so simple. It is not as simple as
  298. just keeping memory allocated by a thread in a list then freeing
  299. the list of allocations when the task exists.
  300. It is not that simple because you don't know how the memory is
  301. being used. For example, if task A allocates memory that is used
  302. by task B, then when task A exits, you would not want to free that
  303. memory needed by task B. In a process-based system, you would
  304. have to explicitly map shared memory (with reference counting) in
  305. order to share memory. So the life of shared memory in that
  306. environment is easily managed.
  307. I have thought that the way that this could be solved in NuttX
  308. would be: (1) add links and reference counts to all memory allocated
  309. by a thread. This would increase the memory allocation overhead!
  310. (2) Keep the list head in the TCB, and (3) extend mmap() and munmap()
  311. to include the shared memory operations (which would only manage
  312. the reference counting and the life of the allocation).
  313. Then what about pthreads? Memory should not be freed until the last
  314. pthread in the group exists. That could be done with an additional
  315. reference count on the whole allocated memory list (just as streams
  316. and file descriptors are now shared and persist until the last
  317. pthread exits).
  318. I think that would work but to me is very unattractive and
  319. inconsistent with the NuttX "small footprint" objective. ...
  320. Other issues:
  321. - Memory free time would go up because you would have to remove
  322. the memory from that list in free().
  323. - There are special cases inside the RTOS itself. For example,
  324. if task A creates task B, then initial memory allocations for
  325. task B are created by task A. Some special allocators would
  326. be required to keep this memory on the correct list (or on
  327. no list at all).
  328. Updated 2016-06-25:
  329. For processors with an MMU (Memory Management Unit), NuttX can be
  330. built in a kernel mode. In that case, each process will have a
  331. local copy of its heap (filled with sbrk()) and when the process
  332. exits, its local heap will be destroyed and the underlying page
  333. memory is recovered.
  334. So in this case, NuttX work just link Linux or or *nix systems:
  335. All memory allocated by processes or threads in processes will
  336. be recovered when the process exits.
  337. But not for the flat memory build. In that case, the issues
  338. above do apply. There is no safe way to recover the memory in
  339. that case (and even if there were, the additional overhead would
  340. not be acceptable on most platforms).
  341. This does not prohibit anyone from creating a wrapper for malloc()
  342. and an atexit() callback that frees memory on task exit. People
  343. are free and, in fact, encouraged, to do that. However, since
  344. it is inherently unsafe, I would never incorporate anything
  345. like that into NuttX.
  346. Status: Open. No changes are planned. NOTE: This applies to the FLAT
  347. and PROTECTED builds only. There is no such leaking of memory
  348. in the KERNEL build mode.
  349. Priority: Medium/Low, a good feature to prevent memory leaks but would
  350. have negative impact on memory usage and code size.
  351. o Power Management (drivers/pm)
  352. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  353. o Signals (sched/signal, arch/)
  354. ^^^^^^^^^^^^^^^^^^^^^^^
  355. Title: STANDARD SIGNALS
  356. Description: 'Standard' signals and signal actions are not supported.
  357. (e.g., SIGINT, SIGSEGV, etc). Default is only SIG_IGN.
  358. Update: SIGCHLD is supported if so configured.
  359. Status: Open. No further changes are planned.
  360. Priority: Low, required by standards but not so critical for an
  361. embedded system.
  362. Title: SIGEV_THREAD
  363. Description: Implementation of support for support for SIGEV_THREAD is available
  364. only in the FLAT build mode because it uses the OS work queues to
  365. perform the callback. The alternative for the PROTECTED and KERNEL
  366. builds would be to create pthreads in the user space to perform the
  367. callbacks. That is not a very attractive solution due to performance
  368. issues. It would also require some additional logic to specify the
  369. TCB of the parent so that the pthread could be bound to the correct
  370. group.
  371. There is also some user-space logic in libc/aio/lio_listio.c. That
  372. logic could use the user-space work queue for the callbacks.
  373. Status: Low, there are alternative designs. However, these features
  374. are required by the POSIX standard.
  375. Priority: Low for now
  376. Title: SIGNAL NUMBERING
  377. Description: In signal.h, the range of valid signals is listed as 0-31. However,
  378. in many interfaces, 0 is not a valid signal number. The valid
  379. signal number should be 1-32. The signal set operations would need
  380. to map bits appropriately.
  381. Status: Open
  382. Priority: Low. Even if there are only 31 usable signals, that is still a lot.
  383. o pthreads (sched/pthreads)
  384. ^^^^^^^^^^^^^^^^^^^^^^^^^
  385. Title: PTHREAD_PRIO_PROTECT
  386. Description: Extend pthread_mutexattr_setprotocol(). It should support
  387. PTHREAD_PRIO_PROTECT (and so should its non-standard counterpart
  388. sem_setproto()).
  389. "When a thread owns one or more mutexes initialized with the
  390. PTHREAD_PRIO_PROTECT protocol, it shall execute at the higher of its
  391. priority or the highest of the priority ceilings of all the mutexes
  392. owned by this thread and initialized with this attribute, regardless of
  393. whether other threads are blocked on any of these mutexes or not.
  394. "While a thread is holding a mutex which has been initialized with
  395. the PTHREAD_PRIO_INHERIT or PTHREAD_PRIO_PROTECT protocol attributes,
  396. it shall not be subject to being moved to the tail of the scheduling queue
  397. at its priority in the event that its original priority is changed,
  398. such as by a call to sched_setparam(). Likewise, when a thread unlocks
  399. a mutex that has been initialized with the PTHREAD_PRIO_INHERIT or
  400. PTHREAD_PRIO_PROTECT protocol attributes, it shall not be subject to
  401. being moved to the tail of the scheduling queue at its priority in the
  402. event that its original priority is changed."
  403. Status: Open. No changes planned.
  404. Priority: Low -- about zero, probably not that useful. Priority inheritance is
  405. already supported and is a much better solution. And it turns out
  406. that priority protection is just about as complex as priority inheritance.
  407. Excerpted from my post in a Linked-In discussion:
  408. "I started to implement this HLS/"PCP" semaphore in an RTOS that I
  409. work with (http://www.nuttx.org) and I discovered after doing the
  410. analysis and basic code framework that a complete solution for the
  411. case of a counting semaphore is still quite complex -- essentially
  412. as complex as is priority inheritance.
  413. "For example, suppose that a thread takes 3 different HLS semaphores
  414. A, B, and C. Suppose that they are prioritized in that order with
  415. A the lowest and C the highest. Suppose the thread takes 5 counts
  416. from A, 3 counts from B, and 2 counts from C. What priority should
  417. it run at? It would have to run at the priority of the highest
  418. priority semaphore C. This means that the RTOS must maintain
  419. internal information of the priority of every semaphore held by
  420. the thread.
  421. "Now suppose it releases one count on semaphore B. How does the
  422. RTOS know that it still holds 2 counts on B? With some complex
  423. internal data structure. The RTOS would have to maintain internal
  424. information about how many counts from each semaphore are held
  425. by each thread.
  426. "How does the RTOS know that it should not decrement the priority
  427. from the priority of C? Again, only with internal complexity. It
  428. would have to know the priority of every semaphore held by
  429. every thread.
  430. "Providing the HLS capability on a simple pthread mutex would not
  431. be such quite such a complex job if you allow only one mutex per
  432. thread. However, the more general case seems almost as complex
  433. as priority inheritance. I decided that the implementation does
  434. not have value to me. I only wanted it for its reduced
  435. complexity; in all other ways I believe that it is the inferior
  436. solution. So I discarded a few hours of programming. Not a
  437. big loss from the experience I gained."
  438. Title: ISSUES WITH CANCELLATION POINTS
  439. Description: According to POIX cancellation points must occur when a thread is executing
  440. the following functions. There are some execptions as noted:
  441. accept() mq_timedsend() NA putpmsg() sigtimedwait()
  442. 04 aio_suspend() NA msgrcv() pwrite() NA sigwait()
  443. NA clock_nanosleep() NA msgsnd() read() sigwaitinfo()
  444. close() NA msync() NA readv() 01 sleep()
  445. connect() nanosleep() recv() 02 system()
  446. -- creat() open() recvfrom() NA tcdrain()
  447. fcntl() pause() NA recvmsg() 01 usleep()
  448. NA fdatasync() poll() select() -- wait()
  449. fsync() pread() sem_timedwait() waitid()
  450. NA getmsg() NA pselect() sem_wait() waitpid()
  451. NA getpmsg() pthread_cond_timedwait() send() write()
  452. NA lockf() pthread_cond_wait() NA sendmsg() NA writev()
  453. mq_receive() pthread_join() sendto()
  454. mq_send() pthread_testcancel() 03 sigpause()
  455. mq_timedreceive() NA putmsg() sigsuspend()
  456. NA Not supported
  457. -- Doesn't need instrumentation. Handled by lower level calls.
  458. nn See note nn
  459. NOTE 01: sleep() and usleep() are user-space functions in the C library and cannot
  460. serve as cancellation points. They are, however, simple wrappers around nanosleep
  461. which is a true cancellation point.
  462. NOTE 02: system() is actually implemented in apps/ as part of NSH. It cannot be
  463. a cancellation point.
  464. NOTE 03: sigpause() is a user-space function in the C library and cannot serve as
  465. cancellation points. It is, however, a simple wrapper around sigsuspend()
  466. which is a true cancellation point.
  467. NOTE 04: aio_suspend() is a user-space function in the C library and cannot serve as
  468. cancellation points. It does call around sigtimedwait() which is a true cancellation
  469. point.
  470. Status: Not really open. This is just the way it is.
  471. Priority: Nothing additional is planned.
  472. Title: PTHREAD FILES IN WRONG LOCATION
  473. Description: There are many pthread interface functions in files located in
  474. sched/pthread. These should be moved from that location to
  475. libc/pthread. In the flat build, this really does not matter,
  476. but in the protected build that location means that system calls
  477. are required to access the pthread interface functions.
  478. Status: Open
  479. Priority: Medium-low. Priority may be higher if system call overheade becomes
  480. an issue.
  481. Title: INAPPROPRIATE USE OF sched_lock() BY pthreads
  482. Description: In implementation of standard pthread functions, the non-
  483. standard, NuttX function sched_lock() is used. This is very
  484. strong sense it disables pre-emption for all threads in all
  485. task groups. I believe it is only really necessary in most
  486. cases to lock threads in the task group with a new non-
  487. standard interface, say pthread_lock().
  488. This is because the OS resources used by a thread such as
  489. mutexes, condition variable, barriers, etc. are only
  490. meaningful from within the task group. So, in order to
  491. performance exclusive operations on these resources, it is
  492. only necessary to block other threads executing within the
  493. task group.
  494. This is an easy change: pthread_lock() and pthread_unlock()
  495. would simply operate on a semaphore retained in the task
  496. group structure. I am, however, hesitant to make this change:
  497. I the flat build model, there is nothing that prevents people
  498. from accessing the inter-thread controls from threads in
  499. differnt task groups. Making this change, while correct,
  500. might introduce subtle bugs in code by people who are not
  501. using NuttX correctly.
  502. Status: Open
  503. Priority: Low. This change would improve real-time performance of the
  504. OS but is not otherwise required.
  505. o Message Queues (sched/mqueue)
  506. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  507. o Kernel/Protected Build
  508. ^^^^^^^^^^^^^^^^^^^^^^
  509. Title: NSH PARTITIONING.
  510. Description: There are issues with several NSH commands in the NuttX kernel
  511. and protected build modes (where NuttX is built as a monolithic
  512. kernel and user code must trap into the protected kernel via
  513. syscalls). The current NSH implementation has several commands
  514. that call directly into kernel internal functions for which
  515. there is no syscall available. The commands cause link failures
  516. in the kernel/protected build mode and must currently be disabled.
  517. Here are known problems that must be fixed:
  518. COMMAND KERNEL INTERFACE(s)
  519. -------- ----------------------------------------------
  520. mkfatfs mkfatfs
  521. mkrd ramdisk_register()
  522. ping icmp_ping()
  523. mount foreach_mountpoint()
  524. The busybox mkfatfs does not involve any OS calls; it does
  525. its job by simply opening the block driver (using open/xopen)
  526. and modifying it with write operations. See:
  527. http://git.busybox.net/busybox/tree/util-linux/mkfs_vfat.c
  528. Status: Open
  529. Priority: Medium/High -- the kernel build configuration is not fully fielded
  530. yet.
  531. Title: apps/system PARTITIONING
  532. Description: Several of the USB device helper applications in apps/system
  533. violate OS/application partitioning and will fail on a kernel
  534. or protected build. Many of these have been fixed by adding
  535. the BOARDIOC_USBDEV_CONTROL boardctl() command. But there are
  536. still issues.
  537. These functions still call directly into operating system
  538. functions:
  539. - cdcacm_classobject - Called from apps/system/composite.
  540. - usbmsc_configure - Called from apps/system/usbmsc and
  541. apps/system/composite
  542. - usbmsc_bindlun - Called from apps/system/usbmsc and
  543. apps/system/composite
  544. - usbmsc_exportluns - Called from apps/system/usbmsc.
  545. Status: Open
  546. Priority: Medium/High -- the kernel build configuration is not fully fielded
  547. yet.
  548. Title: NxTERM PARTITIONING.
  549. Description: NxTerm is implemented (correctly) as a driver that resides
  550. in the nuttx/ directory. However, the user interfaces must be
  551. moved into a NuttX library or into apps/. Currently
  552. applications calls to the NxTerm user interfaces are
  553. undefined in the Kernel/Protected builds.
  554. Status: Open
  555. Priority: Medium
  556. Title: C++ CONSTRUCTORS HAVE TOO MANY PRIVILEGES (PROTECTED MODE)
  557. Description: When a C++ ELF module is loaded, its C++ constructors are called
  558. via sched/task_starthook.c logic. This logic runs in protected mode.
  559. The is a security hole because the user code runs with kernel-
  560. privileges when the constructor executes.
  561. Destructors likely have the opposite problem. The probably try to
  562. execute some kernel logic in user mode? Obviously this needs to
  563. be investigated further.
  564. Status: Open
  565. Priority: Low (unless you need build a secure C++ system).
  566. Title: TOO MANY SYSCALLS
  567. Description: There are a few syscalls that operate very often in user space.
  568. Since syscalls are (relatively) time consuming this could be
  569. a performance issue. Here is some numbers that I collected
  570. in an application that was doing mostly printf output:
  571. sem_post - 18% of syscalls
  572. sem_wait - 18% of syscalls
  573. getpid - 59% of syscalls
  574. --------------------------
  575. 95% of syscalls
  576. Obviously system performance could be improved greatly by simply
  577. optimizing these functions so that they do not need to system calls
  578. so frequently. getpid() is (I believe) part of the re-entrant
  579. semaphore logic. Something like TLS might be used to retain the
  580. thread's ID locally.
  581. Linux, for example, has functions call up() and down(). up()
  582. increments the semaphore count but does not call into the kernel
  583. unless incrementing the count unblocks a task; similarly, down
  584. decrements the count and does not call into the kernel unless
  585. the count becomes negative the caller must be blocked.
  586. Update:
  587. "I am thinking that there should be a "magic" global, user-accessible
  588. variable that holds the PID of the currently executing thread;
  589. basically the PID of the task at the head of the ready-to-run list.
  590. This variable would have to be reset each time the head of the ready-
  591. to-run list changes.
  592. "Then getpid() could be implemented in user space with no system call
  593. by simply reading this variable.
  594. "This one would be easy: Just a change to include/nuttx/userspace.h,
  595. configs/*/kernel/up_userspace.c, libc/, sched/sched_addreadytorun.c, and
  596. sched/sched_removereadytorun.c. That would eliminate 59% of the syscalls."
  597. Update:
  598. This is probably also just a symptom of the OS test that does mostly
  599. console output. The requests for the pid() are part of the
  600. implementation of the I/O's re-entrant semaphore implementation and
  601. would not be an issue in the more general case.
  602. Update:
  603. One solution might be to used CONFIG_TLS, add the PID to struct
  604. tls_info_s. Then the PID could be obtained without a system call.
  605. Status: Open
  606. Priority: Low-Medium. Right now, I do not know if these syscalls are a
  607. real performance issue or not. The above statistics were collected
  608. from a an atypical application (the OS test), and does an excessive
  609. amount of console output. There is probably no issue with more typical
  610. embedded applications.
  611. Title: SECURITY ISSUES
  612. Description: In the current designed, the kernel code calls into the user-space
  613. allocators to allocate user-space memory. It is a security risk to
  614. call into user-space in kernel-mode because that could be exploited
  615. to gain control of the system. That could be fixed by dropping to
  616. user mode before trapping into the memory allocators; the memory
  617. allocators would then need to trap in order to return (this is
  618. already done to return from signal handlers; that logic could be
  619. renamed more generally and just used for a generic return trap).
  620. Another place where the system calls into the user code in kernel
  621. mode is work_usrstart() to start the user work queue. That is
  622. another security hole that should be plugged.
  623. Status: Open
  624. Priority: Low (unless security becomes an issue).
  625. Title: MICRO-KERNEL
  626. Description: The initial kernel build cut many interfaces at a very high level.
  627. The resulting monolithic kernel is then rather large. It would
  628. not be a prohibitively large task to reorganize the interfaces so
  629. that NuttX is built as a micro-kernel, i.e., with only the core
  630. OS services within the kernel and with other OS facilities, such
  631. as the file system, message queues, etc., residing in user-space
  632. and to interfacing with those core OS facilities through traps.
  633. Status: Open
  634. Priority: Low. This is a good idea and certainly an architectural
  635. improvement. However, there is no strong motivation now do
  636. do that partitioning work.
  637. Title: USER MODE TASKS CAN MODIFY PRIVILEGED TASKS
  638. Description: Certain interfaces, such as sched_setparam(),
  639. sched_setscheduler(), etc. can be used by user mode tasks to
  640. modify the behavior of priviledged kernel threads.
  641. task_delete() could even be used to kill a kernel thread.
  642. For a truly secure system. Privileges need to be checked in
  643. every interface that permits one thread to modify the
  644. properties of another thread.
  645. NOTE: It would be a simple matter to simply disable user
  646. threads from modifying privileged threads. However, you
  647. might also want to be able to modify privileged threads from
  648. user tasks with certain permissions. Permissions is a much
  649. more complex issue.
  650. Status: Open
  651. Priority: Low for most embedded systems but would be a critical need if
  652. NuttX were used in a secure system.
  653. o C++ Support
  654. ^^^^^^^^^^^
  655. Title: USE OF SIZE_T IN NEW OPERATOR
  656. Description: The argument of the 'new' operators should take a type of
  657. size_t (see libxx/libxx_new.cxx and libxx/libxx_newa.cxx). But
  658. size_t has an unknown underlying. In the nuttx sys/types.h
  659. header file, size_t is typed as uint32_t (which is determined by
  660. architecture-specific logic). But the C++ compiler may believe
  661. that size_t is of a different type resulting in compilation errors
  662. in the operator. Using the underlying integer type Instead of
  663. size_t seems to resolve the compilation issues.
  664. Status: Kind of open. There is a workaround. Setting CONFIG_CXX_NEWLONG=y
  665. will define the operators with argument of type unsigned long;
  666. Setting CONFIG_CXX_NEWLONG=n will define the operators with argument
  667. of type unsigned int. But this is pretty ugly! A better solution
  668. would be to get a hold of the compilers definition of size_t.
  669. Priority: Low.
  670. Title: STATIC CONSTRUCTORS AND MULTITASKING
  671. Description: The logic that calls static constructors operates on the main
  672. thread of the initial user application task. Any static
  673. constructors that cache task/thread specific information such
  674. as C streams or file descriptors will not work in other tasks.
  675. See also UCLIBC++ AND STATIC CONSTRUCTORS below.
  676. Status: Open
  677. Priority: Low and probably will not changed. In these case, there will
  678. need to be an application specific solution.
  679. Title: UCLIBC++ AND STATIC CONSTRUCTORS
  680. uClibc++ was designed to work in a Unix environment with
  681. processes and with separately linked executables. Each process
  682. has its own, separate uClibc++ state. uClibc++ would be
  683. instantiated like this in Linux:
  684. 1) When the program is built, a tiny start-up function is
  685. included at the beginning of the program. Each program has
  686. its own, separate list of C++ constructors.
  687. 2) When the program is loaded into memory, space is set aside
  688. for uClibc's static objects and then this special start-up
  689. routine is called. It initializes the C library, calls all
  690. of the constructors, and calls atexit() so that the destructors
  691. will be called when the process exits.
  692. In this way, you get a per-process uClibc++ state since there
  693. is per-process storage of uClibc++ global state and per-process
  694. initialization of uClibc++ state.
  695. Compare this to how NuttX (and most embedded RTOSs) would work:
  696. 1) The entire FLASH image is built as one big blob. All of the
  697. constructors are lumped together and all called together at
  698. one time.
  699. This, of course, does not have to be so. We could segregate
  700. constructors by some criteria and we could use a task start
  701. up routine to call constructors separately. We could even
  702. use ELF executables that are separately linked and already
  703. have their constructors separately called when the ELF
  704. executable starts.
  705. But this would not do you very much good in the case of
  706. uClibc++ because:
  707. 2) NuttX does not support processes, i.e., separate address
  708. environments for each task. As a result, the scope of global
  709. data is all tasks. Any change to the global state made by
  710. one task can effect another task. There can only one
  711. uClibc++ state and it will be shared by all tasks. uClibc++
  712. apparently relies on global instances (at least for cin and
  713. cout) there is no way to to have any unique state for any
  714. "task group".
  715. [NuttX does not support processes because in order to have
  716. true processes, your hardware must support a memory management
  717. unit (MMU) and I am not aware of any mainstream MCU that has
  718. an MMU (or, at least an MMU that is capable enough to support
  719. processes).]
  720. NuttX does not have processes, but it does have "task groups".
  721. See http://www.nuttx.org/doku.php?id=wiki:nxinternal:tasksnthreads.
  722. A task group is the task plus all of the pthreads created by
  723. the task via pthread_create(). Resources like FILE streams
  724. are shared within a task group. Task groups are like a poor
  725. man's process.
  726. This means that if the uClibc++ static classes are initialized
  727. by one member of a task group, then cin/cout should work
  728. correctly with all threads that are members of task group. The
  729. destructors would be called when the final member of the task
  730. group exists (if registered via atexit()).
  731. So if you use only pthreads, uClibc++ should work very much like
  732. it does in Linux. If your NuttX usage model is like one process
  733. with many threads then you have Linux compatibility.
  734. If you wanted to have uClibc++ work across task groups, then
  735. uClibc++ and NuttX would need some extensions. I am thinking
  736. along the lines of the following:
  737. 1) There is a per-task group storage are within the RTOS (see
  738. include/nuttx/sched.h). If we add some new, non-standard APIs
  739. then uClibc++ could get access to per-task group storage (in
  740. the spirit of pthread_getspecific() which gives you access to
  741. per-thread storage).
  742. 2) Then move all of uClibc++'s global state into per-task group
  743. storage and add a uClibc++ initialization function that would:
  744. a) allocate per-task group storage, b) call all of the static
  745. constructors, and c) register with atexit() to perform clean-
  746. up when the task group exits.
  747. That would be a fair amount of effort. I don't really know what
  748. the scope of such an effort would be. I suspect that it is not
  749. large but probably complex.
  750. NOTES:
  751. 1) See STATIC CONSTRUCTORS AND MULTITASKING
  752. 2) To my knowledge, only some uClibc++ ofstream logic is
  753. sensitive to this. All other statically initialized classes
  754. seem to work OK across different task groups.
  755. Status: Open
  756. Priority: Low. I have no plan to change this logic now unless there is
  757. some strong demand to do so.
  758. o Binary loaders (binfmt/)
  759. ^^^^^^^^^^^^^^^^^^^^^^^^
  760. Title: NXFLAT TESTS
  761. Description: Not all of the NXFLAT test under apps/examples/nxflat are working.
  762. Most simply do not compile yet. tests/mutex runs okay but
  763. outputs garbage on completion.
  764. Update: 13-27-1, tests/mutex crashed with a memory corruption
  765. problem the last time that I ran it.
  766. Status: Open
  767. Priority: High
  768. Title: ARM UP_GETPICBASE()
  769. Description: The ARM up_getpicbase() does not seem to work. This means
  770. the some features like wdog's might not work in NXFLAT modules.
  771. Status: Open
  772. Priority: Medium-High
  773. Title: NXFLAT READ-ONLY DATA IN RAM
  774. Description: At present, all .rodata must be put into RAM. There is a
  775. tentative design change that might allow .rodata to be placed
  776. in FLASH (see Documentation/NuttXNxFlat.html).
  777. Status: Open
  778. Priority: Medium
  779. Title: GOT-RELATIVE FUNCTION POINTERS
  780. Description: If the function pointer to a statically defined function is
  781. taken, then GCC generates a relocation that cannot be handled
  782. by NXFLAT. There is a solution described in Documentation/NuttXNxFlat.html,
  783. by that would require a compiler change (which we want to avoid).
  784. The simple workaround is to make such functions global in scope.
  785. Status: Open
  786. Priority: Low (probably will not fix)
  787. Title: USE A HASH INSTEAD OF A STRING IN SYMBOL TABLES
  788. Description: In the NXFLAT symbol tables... Using a 32-bit hash value instead
  789. of a string to identify a symbol should result in a smaller footprint.
  790. Status: Open
  791. Priority: Low
  792. Title: WINDOWS-BASED TOOLCHAIN BUILD
  793. Description: Windows build issue. Some of the configurations that use NXFLAT have
  794. the linker script specified like this:
  795. NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
  796. That will not work for windows-based tools because they require Windows
  797. style paths. The solution is to do something like this:
  798. if ($(WINTOOL)y)
  799. NXFLATLDSCRIPT=${cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld}
  800. else
  801. NXFLATLDSCRIPT=$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld
  802. endif
  803. Then use
  804. NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T"$(NXFLATLDSCRIPT)" -no-check-sections
  805. Status: Open
  806. Priority: There are too many references like the above. They will have
  807. to get fixed as needed for Windows native tool builds.
  808. Title: TOOLCHAIN COMPATIBILITY PROBLEM
  809. Description: The older 4.3.3 compiler generates GOTOFF relocations to the constant
  810. strings, like:
  811. .L3:
  812. .word .LC0(GOTOFF)
  813. .word .LC1(GOTOFF)
  814. .word .LC2(GOTOFF)
  815. .word .LC3(GOTOFF)
  816. .word .LC4(GOTOFF)
  817. Where .LC0, LC1, LC2, LC3, and .LC4 are the labels corresponding to strings in
  818. the .rodata.str1.1 section. One consequence of this is that .rodata must reside
  819. in D-Space since it will addressed relative to the GOT (see the section entitled
  820. "Read-Only Data in RAM" at
  821. http://nuttx.org/Documentation/NuttXNxFlat.html#limitations).
  822. The newer 4.6.3 compiler generated PC relative relocations to the strings:
  823. .L2:
  824. .word .LC0-(.LPIC0+4)
  825. .word .LC1-(.LPIC1+4)
  826. .word .LC2-(.LPIC2+4)
  827. .word .LC3-(.LPIC4+4)
  828. .word .LC4-(.LPIC5+4)
  829. This is good and bad. This is good because it means that .rodata.str1.1 can now
  830. reside in FLASH with .text and can be accessed using PC-relative addressing.
  831. That can be accomplished by simply moving the .rodata from the .data section to
  832. the .text section in the linker script. (The NXFLAT linker script is located at
  833. nuttx/binfmt/libnxflat/gnu-nxflat.ld).
  834. This is bad because a lot of stuff may get broken an a lot of test will need to
  835. be done. One question that I have is does this apply to all kinds of .rodata?
  836. Or just to .rodata.str1.1?
  837. Status: Open. Many of the required changes are in place but, unfortunately, not enough
  838. go be fully functional. I think all of the I-Space-to-I-Space fixes are in place.
  839. However, the generated code also includes PC-relative references to .bss which
  840. just cannot be done.
  841. Priority: Medium. The workaround for now is to use the older, 4.3.3 OABI compiler.
  842. o Network (net/, drivers/net)
  843. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  844. Title: LISTENING FOR UDP BROADCASTS
  845. Description: Incoming UDP broadcast should only be accepted if listening on
  846. INADDR_ANY(?)
  847. Status: Open
  848. Priority: Low
  849. Title: CONCURRENT TCP SEND OPERATIONS
  850. Description: At present, there cannot be two concurrent active TCP send
  851. operations in progress using the same socket. This is because
  852. the uIP ACK logic will support only one transfer at a time. The
  853. solution is simple: A mutex will be needed to make sure that each
  854. send that is started is able to be the exclusive sender until all of
  855. the data to be sent has been ACKed.
  856. Status: Open. There is some temporary logic to apps/nshlib that does
  857. this same fix and that temporary logic should be removed when
  858. send() is fixed.
  859. Priority: Medium-Low. This is an important issue for applications that
  860. send on the same TCP socket from multiple threads.
  861. Title: POLL/SELECT ON TCP/UDP SOCKETS NEEDS READ-AHEAD
  862. Description: poll()/select() only works for availability of buffered TCP/UDP
  863. read data (when read-ahead is enabled). The way writing is
  864. handled in the network layer, all sockets must wait when send and
  865. cannot be notified when they can send without waiting.
  866. Status: Open, probably will not be fixed.
  867. Priority: Medium... this does effect porting of applications that expect
  868. different behavior from poll()/select()
  869. Title: SOCKETS DO NOT ALWAYS SUPPORT O_NONBLOCK
  870. Description: sockets do not support all modes for O_NONBLOCK. Sockets
  871. support nonblocking operations only (1) for TCP/IP non-
  872. blocking read operations when read-ahead buffering is
  873. enabled, (2) TCP/IP accept() operations when TCP/IP
  874. connection backlog is enabled, (2) UDP/IP read() operations
  875. when UDP read-ahead is enabled, and (3) non-blocking
  876. operations on Unix domain sockets.
  877. Status: Open
  878. Priority: Low.
  879. Title: UNFINISHED CRYSTALLAN CS89X0 DRIVER
  880. Description: I started coding a CrystalLan CS89x0 driver (drivers/net/cs89x0.c),
  881. but never finished it.
  882. Status: Closed.
  883. Priority: Low. I don't plan to finish the CS89x0 driver. It is just
  884. history now. The unfinished coded is retained in case someone
  885. needs to resurrect it.
  886. Title: INTERFACES TO LEAVE/JOIN IGMP MULTICAST GROUP
  887. Description: The interfaces used to leave/join IGMP multicast groups is non-standard.
  888. RFC3678 (IGMPv3) suggests ioctl() commands to do this (SIOCSIPMSFILTER) but
  889. also status that those APIs are historic. NuttX implements these ioctl
  890. commands, but is non-standard because: (1) It does not support IGMPv3, and
  891. (2) it looks up drivers by their device name (e.g., "eth0") vs IP address.
  892. Linux uses setsockopt() to control multicast group membership using the
  893. IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP options. It also looks up drivers
  894. using IP addresses (It would require additional logic in NuttX to look up
  895. drivers by IP address). See http://tldp.org/HOWTO/Multicast-HOWTO-6.html
  896. Status: Open
  897. Priority: Medium. All standards compatibility is important to NuttX. However, most
  898. the mechanism for leaving and joining groups is hidden behind a wrapper
  899. function so that little of this incompatibilities need be exposed.
  900. Title: CLOSED CONNECTIONS IN THE BACKLOG
  901. If a connection is backlogged but accept() is not called quickly, then
  902. that connection may time out. How should this be handled? Should the
  903. connection be removed from the backlog if it is times out or is closed?
  904. Or should it remain in the backlog with a status indication so that accept()
  905. can fail when it encounters the invalid connection?
  906. Status: Open
  907. Priority: Medium. Important on slow applications that will not accept
  908. connections promptly.
  909. Title: IPv6 REQUIRES ADDRESS FILTER SUPPORT
  910. Description: IPv6 requires that the Ethernet driver support NuttX address
  911. filter interfaces. Several Ethernet drivers do support there,
  912. however. Others support the address filtering interfaces but
  913. have never been verifed:
  914. C5471, LM3S, ez80, DM0x90 NIC, PIC: Do not support address
  915. filtering.
  916. Kinetis, LPC17xx, LPC43xx: Untested address filter support
  917. Status: Open
  918. Priority: Pretty high if you want a to use IPv6 on these platforms.
  919. Title: UDP MULTICAST RECEPTION
  920. Description: The logic in udp_input() expects either a single receive socket or
  921. none at all. However, multiple sockets should be capable of
  922. receiving a UDP datagram (multicast reception). This could be
  923. handled easily by something like:
  924. for (conn = NULL; conn = udp_active (pbuf, conn); )
  925. If the callback logic that receives a packet responds with an
  926. outgoing packet, then it will over-write the received buffer,
  927. however. recvfrom() will not do that, however. We would have
  928. to make that the rule: Recipients of a UDP packet must treat
  929. the packet as read-only.
  930. Status: Open
  931. Priority: Low, unless your logic depends on that behavior.
  932. Title: NETWORK WON'T STAY DOWN
  933. Description: If you enable the NSH network monitor (CONFIG_NSH_NETINIT_MONITOR)
  934. then the NSH 'ifdown' command is broken. Doing 'nsh> ifconfig eth0'
  935. will, indeed, bring the network down. However, the network monitor
  936. notices the change in the link status and will bring the network
  937. back up. There needs to be some kind of interlock between
  938. cmd_ifdown() and the network monitor thread to prevent this.
  939. Status: Open
  940. Priority: Low, this is just a nuisance in most cases.
  941. Title: FIFO CLEAN-UP AFTER CLOSING UNIX DOMAIN DATAGRAM SOCKET
  942. Description: FIFOs are used as the IPC underlying all local Unix domain
  943. sockets. In NuttX, FIFOs are implemented as device drivers
  944. (not as a special FIFO files). The FIFO device driver is
  945. instantiated when the Unix domain socket communications begin
  946. and will automatically be released when (1) the driver is
  947. unlinked and (2) all open references to the driver have been
  948. closed. But there is no mechanism in place now to unlink the
  949. FIFO when the Unix domain datagram socket is no longer used.
  950. The primary issue is timing.. the FIFO should persist until
  951. it is no longer needed. Perhaps there should be a delayed
  952. call to unlink() (using a watchdog or the work queue). If
  953. the driver is re-opened, the delayed unlink could be
  954. canceled? Needs more thought.
  955. NOTE: This is not an issue for Unix domain streams sockets:
  956. The end-of-life of the FIFO is well determined when sockets
  957. are disconnected and support for that case is fully implemented.
  958. Status: Open
  959. Priority: Low for now because I don't have a situation where this is a
  960. problem for me. If you use the same Unix domain paths, then
  961. it is not a issue; in fact it is more efficient if the FIFO
  962. devices persist. But this would be a serious problem if,
  963. for example, you create new Unix domain paths dynamically.
  964. In that case you would effectively have a memory leak and the
  965. number of FIFO instances grow.
  966. Title: TCP IPv4-MAPPED IPv6 ADDRESSES
  967. Description: The UDP implementation in net/udp contains support for Hybrid
  968. dual-stack IPv6/IPv4 implementations that utilize a special
  969. class of addresses, the IPv4-mapped IPv6 addresses. You can
  970. see that UDP implementation in:
  971. udp_callback.c:
  972. ip6_map_ipv4addr(ipv4addr,
  973. udp_send.c:
  974. ip6_is_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr)))
  975. ip6_is_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr))
  976. in_addr_t raddr = ip6_get_ipv4addr((FAR struct in6_addr*)conn->u.ipv6.raddr);
  977. There is no corresponding support for TCP sockets.
  978. Status: Open
  979. Priority: Low. I don't know of any issues now, but I am sure that
  980. someone will encounter this in the future.
  981. Title: MISSING netdb INTERFACES
  982. Description: There is no implementation for many netdb interfaces such as
  983. getaddrinfo(), freeaddrinfo(), getnameinfo(), etc.
  984. Status: Open
  985. Priority: Low
  986. Title: ETHERNET WITH MULTIPLE LPWORK THREADS
  987. Description: Recently, Ethernet drivers were modified to support multiple
  988. work queue structures. The question was raised: "My only
  989. reservation would be, how would this interact in the case of
  990. having CONFIG_STM32_ETHMAC_LPWORK and CONFIG_SCHED_LPNTHREADS
  991. > 1? Can it be guaranteed that one work item won't be
  992. interrupted and execution switched to another? I think so but
  993. am not 100% confident."
  994. I suspect that you right. There are probably vulnerabilities
  995. in the CONFIG_STM32_ETHMAC_LPWORK with CONFIG_SCHED_LPNTHREADS
  996. > 1 case. But that really doesn't depend entirely upon the
  997. change to add more work queue structures. Certainly with only
  998. work queue structure you would have concurrent Ethernet
  999. operations in that multiple LP threads; just because the work
  1000. structure is available, does not mean that there is not dequeued
  1001. work in progress. The multiple structures probably widens the
  1002. window for that concurrency, but does not create it.
  1003. The current Ethernet designs depend upon a single work queue to
  1004. serialize data. In the case of muliple LP threads, some
  1005. additional mechanism would have to be added to enforce that
  1006. serialization.
  1007. NOTE: Most drivers will call net_lock() and net_unlock() around
  1008. the critical portions of the driver work. In that case, all work
  1009. will be properly serialized. This issue only applies to drivers
  1010. that may perform operations that require protection outside of
  1011. the net_lock'ed region. Sometimes, this may require extending
  1012. the netlock() to be beginning of the driver work function.
  1013. Status: Open
  1014. Priority: High if you happen to be using Ethernet in this configuration.
  1015. Title: REPARTITION DRIVER FUNCTIONALITY
  1016. Description: Every network driver performs the first level of packet decoding.
  1017. It examines the packet header and calls ipv4_input(), ipv6_input().
  1018. icmp_input(), etc. as appropriate. This is a maintenance problem
  1019. because it means that any changes to the network input interfaces
  1020. affects all drivers.
  1021. A better, more maintainable solution would use a single net_input()
  1022. function that would receive all incoming packets. This function
  1023. would then perform that common packet decoding logic that is
  1024. currently implemented in every network driver.
  1025. Status: Open
  1026. Priority: Low. Really just as aesthetic maintainability issue.
  1027. Title: BROADCAST WITH MULTIPLE NETWORK INTERFACES
  1028. Description: There is currently no mechanism to send a broadcast packet
  1029. out through several network interfaces. Currently packets
  1030. can be sent to only one device. Logic in netdev_findby_ipvXaddr()
  1031. currently just selects the first device in the list of
  1032. devices; only that device will receive broadcast packets.
  1033. Status: Open
  1034. Priority: High if you require broadcast on multiple networks. There is
  1035. no simple solution known at this time, however. Perhaps
  1036. netdev_findby_ipvXaddr() should return a list of devices rather
  1037. than a single device? All upstream logic would then have to
  1038. deal with a list of devices. That would be a huge effect and
  1039. certainly doesn't dount as a "simple solution".
  1040. Title: ICMPv6 FOR 6LoWPAN
  1041. Description: The current ICMPv6 and neighbor-related logic only works with
  1042. Ethernet MAC. For 6LoWPAN, a new more conservative IPv6
  1043. neigbor discovery is provided by RFC 6775. This RFC needs to
  1044. be supported in order to support ping6 on a 6LoWPAN network.
  1045. If RFC 6775 were implemented, then arbitrary IPv6 addresses,
  1046. including addresses from DHCPv6 could be used.
  1047. UPDATE: With IPv6 neighbor discovery, any IPv6 address may
  1048. be associated with any short or extended address. In fact,
  1049. that is the whole purpose of the neighbor discover logic: It
  1050. plays the same role as ARP in IPv4; it ultimately just manages
  1051. a neighbor table that, like the arp table, provides the
  1052. mapping between IP addresses and node addresses.
  1053. The NuttX, Contiki-based 6LoWPAN implementation circumvented
  1054. the need for the neighbor discovery logic by using only MAC-
  1055. based addressing, i.e., the lower two or eight bytes of the
  1056. IP address are the node address.
  1057. Most of the 6LoWPAN compression algorithms exploit this to
  1058. compress the IPv6 address to nothing but a bit indicating
  1059. that the IP address derives from the node address. So I
  1060. think IPv6 neighbor discover is useless in the current
  1061. implementation.
  1062. If we want to use IPv6 neighbor discovery, we could dispense
  1063. with the all MAC based addressing. But if we want to retain
  1064. the more compact MAC-based addressing, then we don't need
  1065. IPv6 neighbor discovery.
  1066. So, the full neighbor discovery logic is not currently useful,
  1067. but it would still be nice to have enough in place to support
  1068. ping6. Full neighbor support would probably be necessary if we
  1069. wanted to route 6LoWPAN frames outside of the WPAN.
  1070. Status: Open
  1071. Priority: Low for now. I don't plan on implementing this. It would
  1072. only be relevant if we were to decide to abandon the use of
  1073. MAC-based addressing in the 6LoWPAN implementation.
  1074. Title: ETHERNET LOCAL BROADCAST DOES NOT WORK
  1075. Description: In case of "local broadcast" the system still send ARP
  1076. request to the destination, but it shouldn't, it should
  1077. broadcast. For Example, the system has network with IP
  1078. 10.0.0.88, netmask of 255.255.255.0, it should send
  1079. messages for 10.0.0.255 as broadcast, and not send ARP
  1080. for 10.0.0.255
  1081. For more easier networking, the next line should have give
  1082. me the broadcast address of the network, but it doesn't:
  1083. ioctl(_socket_fd, SIOCGIFBRDADDR, &bc_addr);
  1084. Status: Open
  1085. Priority: Medium
  1086. o USB (drivers/usbdev, drivers/usbhost)
  1087. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1088. Title: USB STORAGE DRIVER DELAYS
  1089. Description: There is a workaround for a bug in drivers/usbdev/usbdev_storage.c.
  1090. that involves delays. This needs to be redesigned to eliminate these
  1091. delays. See logic conditioned on CONFIG_USBMSC_RACEWAR.
  1092. If queuing of stall requests is supported by the DCD then this workaround
  1093. is not required. In this case, (1) the stall is not sent until all
  1094. write requests preceding the stall request are sent, (2) the stall is
  1095. sent, and then after the stall is cleared, (3) all write requests
  1096. queued after the stall are sent.
  1097. See, for example, the queuing of pending stall requests in the SAM3/4
  1098. UDP driver at arch/arm/src/sam34/sam_udp.c. There the logic is do this
  1099. is implemented with a normal request queue, a pending request queue, a
  1100. stall flag and a stall pending flag:
  1101. 1) If the normal request queue is not empty when the STALL request is
  1102. received, the stall pending flag is set.
  1103. 2) If addition write requests are received while the stall pending flag
  1104. is set (or while waiting for the stall to be sent), those write requests
  1105. go into the pending queue.
  1106. 3) When the normal request queue empties successful and all of the write
  1107. transfers complete, the STALL is sent. The stall pending flag is
  1108. cleared and the stall flag is set. Now the endpoint is really stalled.
  1109. 4) After the STALL is cleared (via the Clear Feature SETUP), the pending
  1110. request queue is copied to the normal request queue, the stall flag is
  1111. cleared, and normal write request processing resumes.
  1112. Status: Open
  1113. Priority: Medium
  1114. Title: EP0 OUT CLASS DATA
  1115. Description: There is no mechanism in place to handle EP0 OUT data transfers.
  1116. There are two aspects to this problem, neither are easy to fix
  1117. (only because of the number of drivers that would be impacted):
  1118. 1. The class drivers only send EP0 write requests and these are
  1119. only queued on EP0 IN by this drivers. There is never a read
  1120. request queued on EP0 OUT.
  1121. 2. But EP0 OUT data could be buffered in a buffer in the driver
  1122. data structure. However, there is no method currently
  1123. defined in the USB device interface to obtain the EP0 data.
  1124. Updates: (1) The USB device-to-class interface as been extended so
  1125. that EP0 OUT data can accompany the SETUP request sent to the
  1126. class drivers. (2) The logic in the STM32 F4 OTG FS device driver
  1127. has been extended to provide this data. Updates are still needed
  1128. to other drivers.
  1129. Here is an overview of the required changes:
  1130. New two buffers in driver structure:
  1131. 1. The existing EP0 setup request buffer (ctrlreq, 8 bytes)
  1132. 2. A new EP0 data buffer to driver state structure (ep0data,
  1133. max packetsize)
  1134. Add a new state:
  1135. 3. Waiting for EP0 setup OUT data (EP0STATE_SETUP_OUT)
  1136. General logic flow:
  1137. 1. When an EP0 SETUP packet is received:
  1138. - Read the request into EP0 setup request buffer (ctrlreq,
  1139. 8 bytes)
  1140. - If this is an OUT request with data length, set the EP0
  1141. state to EP0STATE_SETUP_OUT and wait to receive data on
  1142. EP0.
  1143. - Otherwise, the SETUP request may be processed now (or,
  1144. in the case of the F4 driver, at the conclusion of the
  1145. SETUP phase).
  1146. 2. When EP0 the EP0 OUT DATA packet is received:
  1147. - Verify state is EP0STATE_SETUP_OUT
  1148. - Read the request into the EP0 data buffer (ep0data, max
  1149. packet size)
  1150. - Now process the previously buffered SETUP request along
  1151. with the OUT data.
  1152. 3. When the setup packet is dispatched to the class driver,
  1153. the OUT data must be passed as the final parameter in the
  1154. call.
  1155. Update 2013-9-2: The new USB device-side driver for the SAMA5D3
  1156. correctly supports OUT SETUP data following the same design as
  1157. per above.
  1158. Update 2013-11-7: David Sidrane has fixed with issue with the
  1159. STM32 F1 USB device driver. Still a few more to go before this
  1160. can be closed out.
  1161. Status: Open
  1162. Priority: High for class drivers that need EP0 data. For example, the
  1163. CDC/ACM serial driver might need the line coding data (that
  1164. data is not used currently, but it might be).
  1165. Title: IMPROVED USAGE of STM32 USB RESOURCES
  1166. Description: The STM32 platforms use a non-standard, USB host peripheral
  1167. that uses "channels" to implement data transfers the current
  1168. logic associates each channel with an pipe/endpoint (with two
  1169. channels for bi-directional control endpoints). The OTGFS
  1170. peripheral has 8 channels and the OTGHS peripheral has 12
  1171. channels.
  1172. This works okay until you add a hub and try connect multiple
  1173. devices. A typical device will require 3-4 pipes and, hence,
  1174. 4-5 channels. This effectively prevents using a hub with the
  1175. STM32 devices. This also applies to the EFM32 which uses the
  1176. same IP.
  1177. It should be possible to redesign the STM32 F4 OTGHS/OTGFS and
  1178. EFM32 host driver so that channels are dynamically assigned to
  1179. pipes as needed for individual transfers. Then you could have
  1180. more "apparent" pipes and make better use of channels.
  1181. Although there are only 8 or 12 channels, transfers are not
  1182. active all of the time on all channels so it ought to be
  1183. possible to have an unlimited number of "pipes" but with no
  1184. more than 8 or 12 active transfers.
  1185. Status: Open
  1186. Priority: Medium-Low
  1187. Title: USB CDC/ACM HOST CLASS DRIVER
  1188. Description: A CDC/ACM host class driver has been added. This has been
  1189. testing by running the USB CDC/ACM host on an Olimex
  1190. LPC1766STK and using the configs/stm3210e-eval/usbserial
  1191. configuration (using the CDC/ACM device side driver). There
  1192. are several unresolved issues that prevent the host driver
  1193. from being usable:
  1194. - The driver works fine when configured for reduced or bulk-
  1195. only protocol on the Olimex LPC1766STK.
  1196. - Testing has not been performed with the interrupt IN channel
  1197. enabled (ie., I have not enabled FLOW control nor do I have
  1198. a test case that used the interrupt IN channel). I can see
  1199. that the polling for interrupt IN data is occurring
  1200. initially.
  1201. - I test for incoming data by doing 'nsh> cat /dev/ttyACM0' on
  1202. the Olimex LPC1766STK host. The bulk data reception still
  1203. works okay whether or not the interupt IN channel is enabled.
  1204. If the interrupt IN channel is enabled, then polling of that
  1205. channel appears to stop when the bulk in channel becomes
  1206. active.
  1207. - The RX reception logic uses the low priority work queue.
  1208. However, that logic never returns and so blocks other use of
  1209. the work queue thread. This is probably okay but means that
  1210. the RX reception logic probably should be moved to its own
  1211. dedicated thread.
  1212. - I get crashes when I run with the STM32 OTGHS host driver.
  1213. Apparently the host driver is trashing memory on receipt
  1214. of data.
  1215. UPDATE: This behavior needs to be retested with:
  1216. commit ce2845c5c3c257d081f624857949a6afd4a4668a
  1217. Author: Janne Rosberg <janne.rosberg@offcode.fi>
  1218. Date: Tue Mar 7 06:58:32 2017 -0600
  1219. usbhost_cdcacm: fix tx outbuffer overflow and remove now
  1220. invalid assert
  1221. commit 3331e9c49aaaa6dcc3aefa6a9e2c80422ffedcd3
  1222. Author: Janne Rosberg <janne.rosberg@offcode.fi>
  1223. Date: Tue Mar 7 06:57:06 2017 -0600
  1224. STM32 OTGHS host: stm32_in_transfer() fails and returns NAK
  1225. if a short transfer is received. This causes problems from
  1226. class drivers like CDC/ACM where short packets are expected.
  1227. In those protocols, any transfer may be terminated by sending
  1228. short or NUL packet.
  1229. commit 0631c1aafa76dbaa41b4c37e18db98be47b60481
  1230. Author: Gregory Nutt <gnutt@nuttx.org>
  1231. Date: Tue Mar 7 07:17:24 2017 -0600
  1232. STM32 OTGFS, STM32 L4 and F7: Adapt Janne Rosberg's patch to
  1233. STM32 OTGHS host to OTGFS host, and to similar implements for
  1234. L4 and F7.
  1235. - The SAMA5D EHCI and the LPC31 EHCI drivers both take semaphores
  1236. in the cancel method. The current CDC/ACM class driver calls
  1237. the cancel() method from an interrupt handler. This will
  1238. cause a crash. Those EHCI drivers should be redesigned to
  1239. permit cancellation from the interrupt level.
  1240. Most of these problems are unique to the Olimex LPC1766STK
  1241. DCD; some are probably design problems in the CDC/ACM host
  1242. driver. The bottom line is that the host CDC/ACM driver is
  1243. still immature and you could experience issues in some
  1244. configurations if you use it.
  1245. That all being said, I know of know no issues with the current
  1246. CDC/ACM driver on the Olimex LPC1766STK platform if the interrupt
  1247. IN endpoint is not used, i.e., in "reduced" mode. The only loss
  1248. of functionality is output flow control.
  1249. UPDATE: The CDC/ACM class driver may also now be functional on
  1250. the STM32. That needs to be verified.
  1251. Status: Open
  1252. Priority: Medium-Low unless you really need host CDC/ACM support.
  1253. o Libraries (libc/, libm/)
  1254. ^^^^^^^^^^^^^^^^^^^^^^^^
  1255. Title: SIGNED time_t
  1256. Description: The NuttX time_t is type uint32_t. I think this is consistent
  1257. with all standards and with normal usage of time_t. However,
  1258. according to Wikipedia, time_t is usually implemented as a
  1259. signed 32-bit value.
  1260. Status: Open
  1261. Priority: Very low unless there is some compelling issue that I do not
  1262. know about.
  1263. Title: ENVIRON
  1264. Description: The definition of environ in stdlib.h is bogus and will not
  1265. work as it should. This is because the underlying
  1266. representation of the environment is not an array of pointers.
  1267. Status: Open
  1268. Priority: Medium
  1269. Title: TERMIOS
  1270. Description: Need some minimal termios support... at a minimum, enough to
  1271. switch between raw and "normal" modes to support behavior like
  1272. that needed for readline().
  1273. UPDATE: There is growing functionality in libc/termios/ and in the
  1274. ioctl methods of several MCU serial drivers (stm32, lpc43, lpc17,
  1275. pic32). However, as phrased, this bug cannot yet be closed since
  1276. this "growing functionality" does not address all termios.h
  1277. functionality and not all serial drivers support termios.
  1278. Status: Open
  1279. Priority: Low
  1280. Title: RESETTING GETOPT()
  1281. Description: There is an issue with the way that getopt() handles errors that
  1282. return '?'.
  1283. 1. Does getopt() reset its global variables after returning '?' so
  1284. that it can be re-used? That would be required to support where
  1285. the caller terminates parsing before reaching the last parameter.
  1286. 2. Or is the client expected to continue parsing after getopt()
  1287. returns '?' and parse until the final parameter?
  1288. The current getopt() implementation only supports #2.
  1289. Status: Open
  1290. Priority: Low
  1291. Title: CONCURRENT STREAM READ/WRITE
  1292. Description: NuttX only supports a single file pointer so reads and writes
  1293. must be from the same position. This prohibits implementation
  1294. of behavior like that required for fopen() with the "a+" mode.
  1295. According to the fopen man page:
  1296. "a+ Open for reading and appending (writing at end of file).
  1297. The file is created if it does not exist. The initial file
  1298. position for reading is at the beginning of the file, but
  1299. output is always appended to the end of the file."
  1300. At present, the single NuttX file pointer is positioned to the
  1301. end of the file for both reading and writing.
  1302. Status: Open
  1303. Priority: Medium. This kind of operation is probably not very common in
  1304. deeply embedded systems but is required by standards.
  1305. Title: DIVIDE BY ZERO
  1306. Description: This is bug 3468949 on the SourceForge website (submitted by
  1307. Philipp Klaus Krause):
  1308. "lib_strtod.c does contain divisions by zero in lines 70 and 96.
  1309. AFAIK, unlike for Java, division by zero is not a reliable way to
  1310. get infinity in C. AFAIK compilers are allowed e.g. give a compile-
  1311. time error, and some, such as sdcc, do. AFAIK, C implementations
  1312. are not even required to support infinity. In C99 the macro isinf()
  1313. could replace the first use of division by zero. Unfortunately, the
  1314. macro INFINITY from math.h probably can't replace the second division
  1315. by zero, since it will result in a compile-time diagnostic, if the
  1316. implementation does not support infinity."
  1317. Status: Open
  1318. Priority:
  1319. Title: OLD dtoa NEEDS TO BE UPDATED
  1320. Description: This implementation of dtoa in libc/stdio is old and will not
  1321. work with some newer compilers. See
  1322. http://patrakov.blogspot.com/2009/03/dont-use-old-dtoac.html
  1323. Status: Open
  1324. Priority: ??
  1325. Title: FLOATING POINT FORMATS
  1326. Description: Only the %f floating point format is supported. Others are
  1327. accepted but treated like %f.
  1328. Status: Open
  1329. Priority: Medium (this might important to someone).
  1330. Title: FLOATING POINT PRECISION
  1331. Description: A fieldwidth and precision is required with the %f format. If %f
  1332. is used with no format, than floating numbers will be printed with
  1333. a precision of 0 (effectively presented as integers).
  1334. Status: Open
  1335. Priority: Medium (this might important to someone).
  1336. Title: LIBM INACCURACIES
  1337. Description: "..if you are writing something like robot control or
  1338. inertial navigation system for aircraft, I have found
  1339. that using the toolchain libmath is only safe option.
  1340. I ported some code for converting quaternions to Euler
  1341. angles to NuttX for my project and only got it working
  1342. after switching to newlib math library.
  1343. "NuttX does not fully implement IEC 60559 floating point
  1344. from C99 (sections marked [MX] in OpenGroup specs) so if
  1345. your code assumes that some function, say pow(), actually
  1346. behaves right for all the twenty or so odd corner cases
  1347. that the standards committees have recently specified,
  1348. you might get surprises. I'd expect pow(0.0, 1.0) to
  1349. return 0.0 (as zero raised to any positive power is
  1350. well-defined in mathematics) but I get +Inf.
  1351. "NuttX atan2(-0.0, -1.0) returns +M_PI instead of correct
  1352. -M_PI. If we expect [MX] functionality, then atan2(Inf, Inf)
  1353. should return M_PI/4, instead NuttX gives NaN.
  1354. "asin(2.0) does not set domain error or return NaN. In fact
  1355. it does not return at all as the loop in it does not
  1356. converge, hanging your app.
  1357. "There are likely many other issues like these as the Rhombus
  1358. OS code has not been tested or used that much. Sorry for not
  1359. providing patches, but we found it easier just to switch the
  1360. math library."
  1361. Ref: https://groups.yahoo.com/neo/groups/nuttx/conversations/messages/7805
  1362. UPDATE: 2015-09-01: A fix for the noted problems with asin()
  1363. has been applied.
  1364. 2016-07-30: Numerous fixes and performance improvements from
  1365. David Alessio.
  1366. Status: Open
  1367. Priority: Low for casual users but clearly high if you need care about
  1368. these incorrect corner case behaviors in the math libraries.
  1369. Title: REPARTITION LIBC FUNCTIONALITY
  1370. Description: There are many things implemented within the kernel (for example
  1371. under sched/pthread) that probably should be migrated in the
  1372. C library where it belongs.
  1373. I would really like to see a little flavor of a micro-kernel
  1374. at the OS interface: I would like to see more primitive OS
  1375. system calls with more higher level logic in the C library.
  1376. One awkward thing is the incompatibility of KERNEL vs FLAT
  1377. builds: In the kernel build, it would be nice to move many
  1378. of the thread-specific data items out of the TCB and into
  1379. the process address environment where they belong. It is
  1380. difficult to make this compatible with the FLAT build,
  1381. however.
  1382. Status: Open
  1383. Priority: Low
  1384. Title: FORMATTING FIXED WIDTH INTEGERS
  1385. Description: Formats like this: lib_vsprintf(_, "%6.6u", 0) do not work.
  1386. There is no support for the precision/width option with
  1387. integer types. The format is simply is ignored and so can
  1388. even cause crashes.
  1389. For example:
  1390. int hello_main(int argc, char *argv[])
  1391. {
  1392. printf("Hello, World!!\n");
  1393. printf("%3.3u %3.3u %3.3u %3.3u %3.3u\n", 9, 99, 999, 9999, 99999);
  1394. return 0;
  1395. }
  1396. Generates this incorrect output:
  1397. NuttShell (NSH) NuttX-7.20
  1398. nsh> hello
  1399. Hello, World!!
  1400. 9 99 999 9999 99999
  1401. nsh>
  1402. That output, of course, should have been:
  1403. 9 99 999 999 999
  1404. The period and the precision value were being ignored (if
  1405. floating point was disabled). In that case, parsing of the
  1406. variable arguments could get out of sync. But a side
  1407. effect of the referenced change is that precision value is
  1408. now always parsed (but still incorrectly ignored for the
  1409. case of integer formats).
  1410. The fix would not be too difficult but would involve change
  1411. several functions. It would involve clipping the size of the
  1412. number string. For example:
  1413. /* Get the width of the output */
  1414. uwidth = getusize(FMT_CHAR, flags, n);
  1415. if (trunc > 0 && uwidth > trunc)
  1416. {
  1417. uwidth = trunc;
  1418. }
  1419. Then limiting the length of the output string to uwidth.
  1420. This would probably mean passing an additional parameter to
  1421. the many *toascii() functions like:
  1422. /* Output the number */
  1423. utoascii(obj, FMT_CHAR, flags, (unsigned int)n, uwidth);
  1424. Status: Open
  1425. Priority: Low
  1426. o File system / Generic drivers (fs/, drivers/)
  1427. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1428. NOTE: The NXFFS file system has its own TODO list at nuttx/fs/nxffs/README.txt
  1429. Title: MISSING FILE SYSTEM FEATURES
  1430. Description: Implement missing file system features:
  1431. chmod() is probably not relevant since file modes are not
  1432. currently supported.
  1433. File privileges would also be good to support. But this is
  1434. really a small part of a much larger feature. NuttX has no
  1435. user IDs, there are no groups, there are no privileges
  1436. associated with either. User's don't need credentials.
  1437. This is really a system wide issues of which chmod is only
  1438. a small part.
  1439. User privileges never seemed important to me since NuttX is
  1440. intended for deeply embedded environments where there are
  1441. not multiple users with varying levels of trust.
  1442. truncate - The standard way of setting a fixed file size.
  1443. Often used with random access, data base files. There is no
  1444. simple way of doing that now (other than just writing data
  1445. to the file).
  1446. link, unlink, softlink, readlink - For symbolic links. Only
  1447. the ROMFS file system currently supports hard and soft links,
  1448. so this is not too important.
  1449. File locking
  1450. Special files - NuttX support special files only in the top-
  1451. level pseudo file system. Unix systems support many
  1452. different special files via mknod(). This would be
  1453. important only if it is an objective of NuttX to become a
  1454. true Unix OS. Again only supported by ROMFS.
  1455. True inodes - Standard Unix inodes. Currently only supported
  1456. by ROMFs.
  1457. The primary obstacle to all these is that each would require
  1458. changes to all existing file systems. That number is pretty
  1459. large. The number of file system implementations that would
  1460. need to be reviewed and modified As of this writing this
  1461. would include binfs, fat, hostfs, nfs, nxffs, procfs, romfs,
  1462. tmpfs, unionfs, plus pseduo-file system support.
  1463. Status: Open
  1464. Priority: Low
  1465. Title: ROMFS CHECKSUMS
  1466. Description: The ROMFS file system does not verify checksums on either
  1467. volume header on on the individual files.
  1468. Status: Open
  1469. Priority: Low. I have mixed feelings about if NuttX should pay a
  1470. performance penalty for better data integrity.
  1471. Title: SPI-BASED SD MULTIPLE BLOCK TRANSFERS
  1472. Description: The simple SPI based MMCS/SD driver in fs/mmcsd does not
  1473. yet handle multiple block transfers.
  1474. Status: Open
  1475. Priority: Medium-Low
  1476. Title: SDIO-BASED SD READ-AHEAD/WRITE BUFFERING INCOMPLETE
  1477. Description: The drivers/mmcsd/mmcsd_sdio.c driver has hooks in place to
  1478. support read-ahead buffering and write buffering, but the logic
  1479. is incomplete and untested.
  1480. Status: Open
  1481. Priority: Low
  1482. Title: POLLHUP SUPPORT
  1483. Description: All drivers that support the poll method should also report
  1484. POLLHUP event when the driver is closed.
  1485. Status: Open
  1486. Priority: Medium-Low
  1487. Title: CONFIG_RAMLOG_CONSOLE DOES NOT WORK
  1488. Description: When I enable CONFIG_RAMLOG_CONSOLE, the system does not come up
  1489. properly (using configuration stm3240g-eval/nsh2). The problem
  1490. may be an assertion that is occurring before we have a console.
  1491. Status: Open
  1492. Priority: Medium
  1493. Title: UNIFIED DESCRIPTOR REPRESENTATION
  1494. Description: There are two separate ranges of descriptors for file and
  1495. socket descriptors: if a descriptor is in one range then it is
  1496. recognized as a file descriptor; if it is in another range
  1497. then it is recognized as a socket descriptor. These separate
  1498. descriptor ranges can cause problems, for example, they makes
  1499. dup'ing descriptors with dup2() problematic. The two groups
  1500. of descriptors are really indices into two separate tables:
  1501. On an array of file structures and the other an array of
  1502. socket structures. There really should be one array that
  1503. is a union of file and socket descriptors. Then socket and
  1504. file descriptors could lie in the same range.
  1505. Another example of how the current implementation limits
  1506. functionality: I recently started to implement of the FILEMAX
  1507. (using pctl() instead sysctl()). My objective was to be able
  1508. to control the number of available file descriptors on a task-
  1509. by-task basis. The complexity due to the partitioning of
  1510. desciptor space in a range for file descriptors and a range
  1511. for socket descriptors made this feature nearly impossible to
  1512. implement.
  1513. Status: Open
  1514. Priority: Low
  1515. Title: DUPLICATE FAT FILE NAMES
  1516. Description: "The NSH and POSIX API interpretations about sensitivity or
  1517. insensitivity to upper/lowercase file names seem to be not
  1518. consistent in our usage - which can result in creating two
  1519. directories with the same name..."
  1520. Example using NSH:
  1521. nsh> echo "Test1" >/tmp/AtEsT.tXt
  1522. nsh> echo "Test2" >/tmp/aTeSt.TxT
  1523. nsh> ls /tmp
  1524. /tmp:
  1525. AtEsT.tXt
  1526. aTeSt.TxT
  1527. nsh> cat /tmp/aTeSt.TxT
  1528. Test2
  1529. nsh> cat /tmp/AtEsT.tXt
  1530. Test1
  1531. Status: Open
  1532. Priority: Low
  1533. Title: MISSING FILES IN NSH 'LS' OF A DIRECTORY
  1534. Description: I have seen cases where (1) long file names are enabled,
  1535. but (2) a short file name is created like:
  1536. nsh> echo "This is another test" >/mnt/sdcard/another.txt
  1537. But then on subsequent 'ls' operations, the file does not appear:
  1538. nsh> ls -l /mnt/sdcard
  1539. I have determined that the problem is because, for some as-
  1540. of-yet-unkown reason the short file name is treated as a long
  1541. file name. The name then fails the long filename checksum
  1542. test and is skipped.
  1543. readdir() (and fat_readdir()) is the logic underlying the
  1544. failure and the problem appears to be something unique to the
  1545. fat_readdir() implementation. Why? Because the file is
  1546. visible when you put the SD card on a PC and because this
  1547. works fine:
  1548. nsh> ls -l /mnt/sdcard/another.txt
  1549. The failure does not happen on all short file names. I do
  1550. not understand the pattern. But I have not had the opportunity
  1551. to dig into this deeply.
  1552. Status: Open
  1553. Priority: Perhaps not a problem??? I have analyzed this problem and
  1554. I am not sure what to do about it. I am suspected that a
  1555. fat filesystem was used with a version of NuttX that does
  1556. not support long file name entries. Here is the failure
  1557. scenario:
  1558. 1) A file with a long file name is created under Windows.
  1559. 2) Then the file is deleted. I am not sure if Windows or
  1560. NuttX deleted the file, but the resulting directory
  1561. content is not compatible with NuttX with long file
  1562. name support.
  1563. The file deletion left the full sequence of long
  1564. file name entries intact but apparently delete only
  1565. the following short file name entry. I am thinking
  1566. that this might have happened because a version of NuttX
  1567. with only short file name support was used to delete
  1568. the file.
  1569. 3) When a new file with a short file name was created, it
  1570. re-used the short file name entry that was previously
  1571. deleted. This makes the new short file name entry
  1572. look like a part of the long file name.
  1573. 4) When comparing the checksum in the long file name
  1574. entry with the checksum of the short file name, the
  1575. checksum fails and the entire directory sequence is
  1576. ignored by readder() logic. This the file does not
  1577. appear in the 'ls'.
  1578. o Graphics Subsystem (graphics/)
  1579. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1580. See also the NxWidgets TODO list file for related issues.
  1581. Title: UNTESTED GRAPHICS APIS
  1582. Description: Testing of all APIs is not complete. See
  1583. http://nuttx.sourceforge.net/NXGraphicsSubsystem.html#testcoverage
  1584. Status: Open
  1585. Priority: Medium
  1586. Title: ITALIC FONTS / NEGATIVE FONT OFFSETS
  1587. Description: Font metric structure (in include/nuttx/nx/nxfont.h) should allow
  1588. negative X offsets. Negative x-offsets are necessary for certain
  1589. glyphs (and is very common in italic fonts).
  1590. For example Eth, icircumflex, idieresis, and oslash should have
  1591. offset=1 in the 40x49b font (these missing negative offsets are
  1592. NOTE'ed in the font header files).
  1593. Status: Open. The problem is that the x-offset is an unsigned bitfield
  1594. in the current structure.
  1595. Priority: Low.
  1596. Title: RAW WINDOW AUTORAISE
  1597. Description: Auto-raise only applies to NXTK windows. Shouldn't it also apply
  1598. to raw windows as well?
  1599. Status: Open
  1600. Priority: Low
  1601. Title: AUTO-RAISE DISABLED
  1602. Description: Auto-raise is currently disabled in NX multi-server mode. The
  1603. reason is complex:
  1604. - Most touchscreen controls send touch data a high rates
  1605. - In multi-server mode, touch events get queued in a message
  1606. queue.
  1607. - The logic that receives the messages performs the auto-raise.
  1608. But it can do stupid things after the first auto-raise as
  1609. it operates on the stale data in the message queue.
  1610. I am thinking that auto-raise ought to be removed from NuttX
  1611. and moved out into a graphics layer (like NxWM) that knows
  1612. more about the appropriate context to do the autoraise.
  1613. Status: Open
  1614. Priority: Medium low
  1615. Title: NxTERM VT100 SUPPORT
  1616. Description: If the NxTerm will be used with the Emacs-like command line
  1617. editor (CLE), then it will need to support VT100 cursor control
  1618. commands.
  1619. Status: Open
  1620. Priority: Low, the need has not yet arisen.
  1621. Title: PER-WINDOW FRAMEBUFFERS
  1622. Description: One of the most awkward things to handle in the NX windowing
  1623. system is the re-draw callback. This is difficult because it
  1624. requires ad hoc, custom logic to be able to do the redrawing
  1625. in most cases.
  1626. One solution would be to provide a per-window framebuffer.
  1627. All rending would be performed into the per-window framebuffer
  1628. and the rended bits would be copied the LCD or framebuffer
  1629. device memory on demand when the redraw is required.
  1630. This would (a) greatly simplify the graphics interface, (b)
  1631. greatly improve redraw performance, and (c) enable a more
  1632. generic use of the windowing. The downside would be a large
  1633. usage of memory to hold all of the framebuffers, one for each
  1634. window.
  1635. Status: Open
  1636. Priority: Low, of mostly strategic value.
  1637. Title: VERTICAL ANTI-ALIASING
  1638. Description: Anti-aliasing is implemented along the horizontal raster line
  1639. with fractional pixels at the ends of each line. There is no
  1640. accounting for fractional pixels in the vertical direction.
  1641. As a result lines closer to vertical receive better anti-
  1642. aliasing than lines closer to horizontal.
  1643. Status: Open
  1644. Priority: Low, not a serious issue but worth noting. There is no plan
  1645. to change this behavior.
  1646. Title: REMOVE SINGLE USER MODE
  1647. Description: NX graphics supports two modes: A simple single user mode and
  1648. more complex multi-user mode selected with CONFIG_NX_MULTIUSER=y.
  1649. In this configuration, an application can start the NX server
  1650. with boardctrl(BOARDIOC_NX_START); After that, all graphic
  1651. interactions are via a thin layer in libnx/. The OS
  1652. interface is only via messages sent and received using POSIX
  1653. message queues. So this is good code and respects all of the
  1654. POSIX interfacing rules. Hence, it works well in all build
  1655. modes (FLAT, PROTECTED, and KERNEL builds).
  1656. But without CONFIG_NX_MULTIUSER, the single user applications
  1657. violate all of the rules and calls internal NX functions
  1658. directly. This includes all calls to internal OSfunctions
  1659. with names like, nx_open, up_fbinitialize, board_lcd_*, and
  1660. others. This is a violation of interfacing standard in all
  1661. cases and can only be made to work in the FLAT build mode.
  1662. The single user mode does have some desirable properties: It
  1663. is lighter weight and so more suitable for very resource limited
  1664. platforms. But I think that in the long run the only reasonable
  1665. solution is to eliminate the single user mode and provide only
  1666. the multi-user mode with the message queue interface.
  1667. Status: Open
  1668. Priority: Low-Medium, not a serious issue but worth noting. Single user
  1669. mode is a blemish on the OS and not compatible with the RTOS
  1670. roadmap. But neither is there any critical necessity to
  1671. remove the offending code immediately. Be aware: If you use
  1672. the single user mode, it will be yanked out from under your
  1673. feet in the not-so-distant future.
  1674. Title: WIDE-FOUNT SUPPORT
  1675. Description: Wide fonts are not currently supported by the NuttX graphics sub-
  1676. system. There is some discussion here:
  1677. https://groups.yahoo.com/neo/groups/nuttx/conversations/topics/3507
  1678. http://www.nuttx.org/doku.php?id=wiki:graphics:wide-fonts
  1679. Status: Open
  1680. Priority: Low for many, but I imagine higher in countries that use wide fonts
  1681. o Build system
  1682. ^^^^^^^^^^^^
  1683. Title: MAKE EXPORT LIMITATIONS
  1684. Description: The top-level Makefile 'export' target that will bundle up all of the
  1685. NuttX libraries, header files, and the startup object into an export-able
  1686. tarball. This target uses the tools/mkexport.sh script. Issues:
  1687. 1. This script assumes the host archiver ar may not be appropriate for
  1688. non-GCC toolchains
  1689. 2. For the kernel build, the user libraries should be built into some
  1690. libuser.a. The list of user libraries would have to accepted with
  1691. some new argument, perhaps -u.
  1692. Status: Open
  1693. Priority: Low.
  1694. Title: CONTROL-C CAN BREAK DEPENDENCIES
  1695. Description: If you control C out of a make, then there are things that can go
  1696. wrong. For one, you can break the dependencies in this scenario:
  1697. - The build in a given directory begins with all of the compilations.
  1698. On terminal, this the long phase with CC: on each line. As each
  1699. .o file is created, it is timestamped with the current time.
  1700. - The dependencies on each .o are such that the C file will be re-
  1701. compile if the .o file is OLDER that the corresponding .a archive
  1702. file.
  1703. - The compilation phase is followed by a single, relatively short
  1704. AR: phase that adds each of the file to the .a archive file. As
  1705. each file is added to archive, the timestamp of the of archive is
  1706. updated to the current time. After the first .o file has been
  1707. added, then archive file will have a newer timestamp than any of
  1708. the newly compiled .o file.
  1709. - If the user aborts with control-C during this AR: phase, then we
  1710. are left with: (1) not all of the files have bee added to the
  1711. archive, and (2) the archive file has a newer timestamp than any
  1712. of the .o file.
  1713. So when the make is restarted after a control, the dependencies will
  1714. see that the .a archive file has the newer time stamp and those .o
  1715. file will never be added to the archive until the directory is cleaned
  1716. or some other dependency changes.
  1717. NOTE: This may not really be an issue because the the timestamp on
  1718. libapps.a is not really used but rather the timestamp on an empty
  1719. file:
  1720. .built: $(OBJS)
  1721. $(call ARCHIVE, $(BIN), $(OBJS))
  1722. $(Q) touch $@
  1723. UPDATE: But there is another way that Control-C can break dependencies:
  1724. If you control-c out of the make during the apps/ part of the build,
  1725. the archive at apps/libapps.a is deleted (but all of the .built files
  1726. remain in place). You can see this in the make outout, for example:
  1727. CC: ieee802154_getsaddr.c
  1728. make[2]: *** [Makefile:104: ieee802154_getsaddr.o] Interrupt
  1729. make: *** Deleting file '../apps/libapps.a'
  1730. When you rebuild the system, the first file archived will recreate
  1731. libapps.a and set the timestamp to the current time. Then, none of
  1732. the other object files will be added to the archive because they are
  1733. all older.. or, more correctly, none of the other object files will
  1734. be addred because .built files remained and say that there is no
  1735. need to update the libapps.a file.
  1736. The typical symptom of such an issue is a link time error like:
  1737. LD: nuttx libsched.a(os_bringup.o): In function `os_bringup':
  1738. os_bringup.c:(.text+0x34): undefined reference to `nsh_main'
  1739. This is becuase the libapps.a file was deleted and an new empty
  1740. libapps.a file was created (which the object containing nsh_main()).
  1741. The object containing nsh_main() will not be added because the
  1742. .built file exists and says that there is not need to add the
  1743. nsh_main() object to libapps.a.
  1744. The work-around for now is:
  1745. $ make apps_distclean
  1746. One solution to this might be to making the special target
  1747. .PRECIOUS depend on apps/libapps.a. Then if make receives a
  1748. signal, it will not delete apps/libapps.a. This would have to
  1749. be done in all Makefiles.
  1750. Status Open
  1751. Priority: Medium-High. It is a rare event that control-C happens at just the
  1752. point in time. However, when it does occur the resulting code may
  1753. have binary incompatiblies in the code taken from the out-of-sync
  1754. archives and cost a lot of debug time before you realize the issue.
  1755. The first stated problem is not really an issue: There is already
  1756. the spurious .built file that should handle the described case:
  1757. If you control-C out of the build then the timestamp on the .built
  1758. file will not be updated and the archiving should be okay on the
  1759. next build.
  1760. A work-around for the second stated problem is to do 'make clean'
  1761. if you ever decide to control-C out of a make and see that the
  1762. libapps.a file was deleted.
  1763. UPDATE: This is a potential fix for the second problem in place
  1764. in in all Makefiles under apps/. This fix adds
  1765. .PRECIOUS: $(BIN)
  1766. to all Makefiles. It has not yet been confirmed that this fix
  1767. eliminates the dependency issue or not.
  1768. o Other drivers (drivers/)
  1769. ^^^^^^^^^^^^^^^^^^^^^^^^
  1770. o Linux/Cywgin simulation (arch/sim)
  1771. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1772. Title: SIMULATOR HAS NO INTERRUPTS (NON-PREMPTIBLE)
  1773. Description: The current simulator implementation is has no interrupts and, hence,
  1774. is non-preemptible. Also, without simulated interrupt, there can
  1775. be no high-fidelity simulated device drivers.
  1776. Currently, all timing and serial input is simulated in the IDLE loop:
  1777. When nothing is going on in the simulation, the IDLE loop runs and
  1778. fakes timer and UART events.
  1779. Status: Open
  1780. Priority: Low, unless there is a need for developing a higher fidelity simulation
  1781. I have been thinking about how to implement simulated interrupts in
  1782. the simulation. I think a solution would work like this:
  1783. http://www.nuttx.org/doku.php?id=wiki:nxinternal:simulator
  1784. Title: ROUND-ROBIN SCHEDULING IN THE SIMULATOR
  1785. Description: Since the simulation is not pre-emptible, you can't use round-robin
  1786. scheduling (no time slicing). Currently, the timer interrupts are
  1787. "faked" during IDLE loop processing and, as a result, there is no
  1788. task pre-emption because there are no asynchronous events. This could
  1789. probably be fixed if the "timer interrupt" were driver by Linux
  1790. signals. NOTE: You would also have to implement up_irq_save() and
  1791. up_irq_restore() to block and (conditionally) unblock the signal.
  1792. Status: Open
  1793. Priority: Low
  1794. Title: SMP SIMULATION ISSUES
  1795. Description: The configuration has basic support SMP testing. The simulation
  1796. supports the emulation of multiple CPUs by creating multiple
  1797. pthreads, each run a copy of the simulation in the same process
  1798. address space.
  1799. At present, the SMP simulation is not fully functional: It does
  1800. operate on the simulated CPU threads for a few context switches
  1801. then fails during a setjmp() operation. I suspect that this is
  1802. not an issue with the NuttX SMP logic but more likely some chaos
  1803. in the pthread controls. I have seen similar such strange behavior
  1804. other times that I have tried to use setjmp/longmp from a signal
  1805. handler! Like when I tried to implement simulated interrupts
  1806. using signals.
  1807. Apparently, if longjmp is invoked from the context of a signal
  1808. handler, the result is undefined:
  1809. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1318.htm
  1810. You can enable SMP for ostest configuration by enabling:
  1811. -# CONFIG_EXPERIMENTAL is not set
  1812. +CONFIG_EXPERIMENTAL=y
  1813. +CONFIG_SPINLOCK=y
  1814. +CONFIG_SMP=y
  1815. +CONFIG_SMP_NCPUS=2
  1816. +CONFIG_SMP_IDLETHREAD_STACKSIZE=2048
  1817. You also must enable near-realtime-performance otherwise even long
  1818. timeouts will expire before a CPU thread even has a chance to
  1819. execute.
  1820. -# CONFIG_SIM_WALLTIME is not set
  1821. +CONFIG_SIM_WALLTIME=y
  1822. And you can enable some additional debug output with:
  1823. -# CONFIG_DEBUG_SCHED is not set
  1824. +CONFIG_DEBUG_SCHED=y
  1825. -# CONFIG_SCHED_INSTRUMENTATION is not set
  1826. +CONFIG_SCHED_INSTRUMENTATION=y
  1827. The NSH configuration can also be forced to run SMP, but
  1828. suffers from the same quirky behavior. I can be made
  1829. reliable if you modify arch/sim/src/up_idle.c so that
  1830. the IDLE loop only runs for CPU0. Otherwise, often
  1831. simuart_post() will be called from CPU1 and it will try
  1832. to restart NSH on CPU0 and, again, the same quirkiness
  1833. occurs.
  1834. But for example, this command:
  1835. nsh> sleep 1 &
  1836. will execute the sleep command on CPU1 which has worked
  1837. every time that I have tried it (which is not too many
  1838. times).
  1839. Status: Open
  1840. Priority: Low, SMP is important, but SMP on the simulator is not
  1841. o ARM (arch/arm/)
  1842. ^^^^^^^^^^^^^^^
  1843. Title: IMPROVED ARM INTERRUPT HANDLING
  1844. Description: ARM interrupt handling performance could be improved in some
  1845. ways. One easy way is to use a pointer to the context save
  1846. area in g_current_regs instead of using up_copystate so much.
  1847. This approach is already implemented for the ARM Cortex-M0,
  1848. Cortex-M3, Cortex-M4, and Cortex-A5 families. But still needs
  1849. to be back-ported to the ARM7 and ARM9 (which are nearly
  1850. identical to the Cortex-A5 in this regard). The change is
  1851. *very* simple for this architecture, but not implemented.
  1852. Status: Open. But complete on all ARM platforms except ARM7 and ARM9.
  1853. Priority: Low.
  1854. Title: IMPROVED ARM INTERRUPT HANDLING
  1855. Description: The ARM and Cortex-M3 interrupt handlers restores all registers
  1856. upon return. This could be improved as well: If there is no
  1857. context switch, then the static registers need not be restored
  1858. because they will not be modified by the called C code.
  1859. (see arch/renesas/src/sh1/sh1_vector.S for example)
  1860. Status: Open
  1861. Priority: Low
  1862. Title: CORTEX-M3 STACK OVERFLOW
  1863. Description: There is bit bit logic in up_fullcontextrestore() that executes on
  1864. return from interrupts (and other context switches) that looks like:
  1865. ldr r1, [r0, #(4*REG_CPSR)] /* Fetch the stored CPSR value */
  1866. msr cpsr, r1 /* Set the CPSR */
  1867. /* Now recover r0 and r1 */
  1868. ldr r0, [sp]
  1869. ldr r1, [sp, #4]
  1870. add sp, sp, #(2*4)
  1871. /* Then return to the address at the stop of the stack,
  1872. * destroying the stack frame
  1873. */
  1874. ldr pc, [sp], #4
  1875. Under conditions of excessively high interrupt conditions, many
  1876. nested interrupts can occur just after the 'msr cpsr' instruction.
  1877. At that time, there are 4 bytes on the stack and, with each
  1878. interrupt, the stack pointer may increment and possibly overflow.
  1879. This can happen only under conditions of continuous interrupts.
  1880. See this email thread: https://groups.yahoo.com/neo/groups/nuttx/conversations/messages/1261
  1881. On suggested change is:
  1882. ldr r1, [r0, #(4*REG_CPSR)] /* Fetch the stored CPSR value */
  1883. msr spsr_cxsf, r1 /* Set the CPSR */
  1884. ldmia r0, {r0-r15}^
  1885. But this has not been proven to be a solution.
  1886. UPDATE: Other ARM architectures have a similar issue.
  1887. Status: Open
  1888. Priority: Low. The conditions of continuous interrupts is really the problem.
  1889. If your design needs continuous interrupts like this, please try
  1890. the above change and, please, submit a patch with the working fix.
  1891. Title: IMPROVED TASK START-UP AND SYSCALL RETURN
  1892. Description: Couldn't up_start_task and up_start_pthread syscalls be
  1893. eliminated. Wouldn't this work to get us from kernel-
  1894. to user-mode with a system trap:
  1895. lda r13, #address
  1896. str rn, [r13]
  1897. msr spsr_SVC, rm
  1898. ld r13,{r15}^
  1899. Would also need to set r13_USER and r14_USER. For new
  1900. SYS_context_switch... couldn't we do he same thing?
  1901. Also... System calls use traps to get from user- to kernel-
  1902. mode to perform OS services. That is necessary to get from
  1903. user- to kernel-mode. But then another trap is used to get
  1904. from kernel- back to user-mode. It seems like this second
  1905. trap should be unnecessary. We should be able to do the
  1906. same kind of logic to do this.
  1907. Status: Open
  1908. Priority: Low-ish, but a good opportunity for performance improvement.
  1909. o Network Utilities (apps/netutils/)
  1910. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1911. Title: UNVERIFIED THTTPD FEATURES
  1912. Description: Not all THTTPD features/options have been verified. In
  1913. particular, there is no test case of a CGI program receiving
  1914. POST input. Only the configuration of apps/examples/thttpd
  1915. has been tested.
  1916. Status: Open
  1917. Priority: Medium
  1918. Title: NETWORK MONITOR NOT GENERALLY AVAILABLE
  1919. Description: The NSH network management logic has general applicability
  1920. but is currently useful only because it is embedded in the NSH
  1921. module. It should be moved to apps/system or, better,
  1922. apps/netutils.
  1923. Status: Open
  1924. Priority: Low
  1925. o NuttShell (NSH) (apps/nshlib)
  1926. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1927. Title: IFCONFIG AND MULTIPLE NETWORK INTERFACES
  1928. Description: The ifconfig command will not behave correctly if an interface
  1929. is provided and there are multiple interfaces. It should only
  1930. show status for the single interface on the command line; it will
  1931. still show status for all interfaces.
  1932. Status: Open
  1933. Priority: Low
  1934. o System libraries apps/system (apps/system)
  1935. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1936. Title: READLINE IMPLEMENTATION
  1937. Description: readline implementation does not use C-buffered I/O, but rather
  1938. talks to serial driver directly via read(). It includes VT-100
  1939. specific editing commands. A more generic readline() should be
  1940. implemented using termios' tcsetattr() to put the serial driver
  1941. into a "raw" mode.
  1942. Status: Open
  1943. Priority: Low (unless you are using mixed C-buffered I/O with readline and
  1944. fgetc, for example).
  1945. o Modbus (apps/modbus)
  1946. ^^^^^^^^^^^^^^^^^^^^
  1947. Title: MODBUS NOT USABLE WITH USB SERIAL
  1948. Description: Modbus can be used with USB serial, however, if the USB
  1949. serial connectiont is lost, Modbus will hang in an infinite
  1950. loop.
  1951. This is a problem in the handling of select() and read()
  1952. and could probabaly resolved by studying the Modbus error
  1953. handling.
  1954. A more USB-friendly solution would be to: (1) Re-connect and
  1955. (2) re-open the serial drviers. That is what is done is NSH.
  1956. When the serial USB device is removed, this terminates the
  1957. session and NSH will then try to re-open the USB device. See
  1958. the function nsh_waitusbready() in the file
  1959. apps/nshlib/nsh_usbconsole.c. When the USB serial is
  1960. reconnected the open() in the function will succeed and a new
  1961. session will be started.
  1962. Status: Open
  1963. Priority: Low. This is really an enhancement request: Modbus was never
  1964. designed to work with removable serial devices.
  1965. o Pascal Add-On (pcode/)
  1966. ^^^^^^^^^^^^^^^^^^^^^^
  1967. Title: P-CODES IN MEMORY UNTESTED
  1968. Description: Need APIs to verify execution of P-Code from memory buffer.
  1969. Status: Open
  1970. Priority: Low
  1971. Title: SMALLER LOADER AND OBJECT FORMAT
  1972. Description: Loader and object format may be too large for some small
  1973. memory systems. Consider ways to reduce memory footprint.
  1974. Status: Open
  1975. Priority: Medium
  1976. Title: PDBG
  1977. Description: Move the pascal p-code debugger into the NuttX apps/ tree
  1978. where it can be used from the NSH command line.
  1979. Status: Open
  1980. Priority: Low
  1981. o Other Applications & Tests (apps/examples/)
  1982. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1983. Title: EXAMPLES/PIPE ON CYGWIN
  1984. Description: The redirection test (part of examples/pipe) terminates
  1985. incorrectly on the Cywgin-based simulation platform (but works
  1986. fine on the Linux-based simulation platform).
  1987. Status: Open
  1988. Priority: Low
  1989. Title: EXAMPLES/SENDMAIL UNTESTED
  1990. Description: examples/sendmail is untested on the target (it has been tested
  1991. on the host, but not on the target).
  1992. Status: Open
  1993. Priority: Med
  1994. Title: EXAMPLES/NX FONT CACHING
  1995. Description: The font caching logic in examples/nx is incomplete. Fonts are
  1996. added to the cache, but never removed. When the cache is full
  1997. it stops rendering. This is not a problem for the examples/nx
  1998. code because it uses so few fonts, but if the logic were
  1999. leveraged for more general purposes, it would be a problem.
  2000. Update: see examples/nxtext for some improved font cache handling.
  2001. Update: The NXTERM font cache has been generalized and is now
  2002. offered as the standard, common font cache for all applications.
  2003. both the nx and nxtext examples should be modified to use this
  2004. common font cache. See interfaces defined in nxfonts.h.
  2005. Status: Open
  2006. Priority: Low. This is not really a problem because examples/nx works
  2007. fine with its bogus font caching.
  2008. Title: EXAMPLES/NXTEXT ARTIFACTS
  2009. Description: examples/nxtext. Artifacts when the pop-up window is opened.
  2010. There are some artifacts that appear in the upper left hand
  2011. corner. These seems to be related to window creation. At
  2012. tiny artifact would not be surprising (the initial window
  2013. should like at (0,0) and be of size (1,1)), but sometimes
  2014. the artifact is larger.
  2015. Status: Open
  2016. Priority: Medium.