2015-09-15 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.10. * doc/chopstx.texi (VERSION): 0.10. * example-cdc/usb_stm32f103.c: Update from Gnuk. 2015-09-14 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (q_exit): Remove. (chx_init, chx_exit): Remove access to Q_EXIT. (chx_release_irq_thread): Fix removing form the list. 2015-09-11 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_init, chopstx_create): Fix the initial value of flag_cancelable. 2015-09-10 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.09. * doc/chopstx.texi (VERSION): 0.09. * chopstx.c (chx_release_irq_thread): Rename. 2015-09-09 Niibe Yutaka <gniibe@fsij.org> * example-cdc/usb-cdc.c (usb_cb_ctrl_write_finish): Distinguish DTR signal. (usb_cb_device_reset): Fix USB reset handling. * chopstx.c (chopstx_usec_wait_var, chopstx_cond_wait) (chopstx_intr_wait): Call chopstx_testcancel. (chopstx_setcancelstate): New. * chopstx.c (chx_systick_reset, chx_systick_reload) (chx_systick_get): Factor out systick functions. (chx_prio_init): Factor out. 2015-09-08 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_request_preemption): Add PRIO argument and check the condition inside. (chx_timer_expired, chx_handle_intr): Call unconditionally. (intr_lock): New variable. (chx_handle_intr, chopstx_claim_irq, chopstx_release_irq) (chopstx_release_irq_thread): Add spin lock with intr_lock. * chopstx.h (chx_intr): Remove member LOCK. 2015-09-07 Niibe Yutaka <gniibe@fsij.org> * example-primer2: New from Kazumoto Kojima. * board/board-nitrokey-start.h (VAL_GPIO_USB_ODR) (VAL_GPIO_USB_CRL): Fix the values for NeuG settings. 2015-09-04 Niibe Yutaka <gniibe@fsij.org> * example-cdc/sys.h (BOARD_ID_NITROKEY_START): New. * board/board-nitrokey-start.h (BOARD_ID): Fix the value. * clk_gpio_init.c (AFIO_MAPR_SWJ_CFG_JTAGDISABLE): New. 2015-08-07 Mateusz Zalega <mateusz@nitrokey.com> * board/board-nitrokey-start.h: New. 2015-08-06 Niibe Yutaka <gniibe@fsij.org> * example-fsm-55/README: Updated. 2015-07-31 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.08. * doc/chopstx.texi (VERSION): 0.08. * example-fsm-55/Makefile (DEFS): Remove HAVE_SYS_H. Add MAKE_ENTRY_PUBLIC. * example-fsm-55/hacker-emblem.ld: Put vectors on ROM. * example-fsm-55/sys.c: No system services. * entry.c (entry): Can be public. * clk_gpio_init.c [MCU_STM32F0] (clock_init): Don't change CFGR1. 2015-07-30 Niibe Yutaka <gniibe@fsij.org> * board/board-st-nucleo-f103.h: New. Contributed by Kenji Rikitake. 2015-07-29 Niibe Yutaka <gniibe@fsij.org> * board/board-st-dongle.h: New. Contributed by Kenji Rikitake. * board/board-*.h (FLASH_PAGE_SIZE): Remove. 2015-07-28 Niibe Yutaka <gniibe@fsij.org> * example-cdc/usb_stm32f103.c: Update from Gnuk. * example-cdc/usb_lld.h: Ditto. * example-cdc/usb-cdc.c: Follow the change. 2015-07-15 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.07. * doc/chopstx.texi (VERSION): 0.07. 2015-07-14 Niibe Yutaka <gniibe@fsij.org> * board/board-*.h (BOARD_ID): New. * example-cdc/sys.c (sys_board_id): New. * example-cdc/sample.ld (.sys.board_id): New. (__flash_start__, __flash_end__): Remove. * entry.c [HAVE_SYS_H] (vector_table): By undefining STM32F10X_MD, prepare for high density device even compiled for MD device. 2015-07-13 Kaz Kojima <kkojima@rr.iij4u.or.jp> * board/board-stm32-primer2.h: Update. * entry.c (vector_table): Less or more. 2015-07-13 Niibe Yutaka <gniibe@fsij.org> * board/board-*.h (BOARD_NAME): New. (STM32F10X_MD): Define for medium-density devices. * example-led/sys.c, sample.ld: Update. * example-fsm-55/sys.c, hacker-emblem.ld: Update. * example-cdc/sys.c (sys_board_name): New. * example-cdc/sample.ld: Update. 2015-07-08 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.06. * doc/chopstx.texi (VERSION): 0.06. 2015-07-07 Niibe Yutaka <gniibe@fsij.org> * example-fsm-55/sys.c: Include clk_gpio_init.c. * board/board-stm32f0-discovery.h, board/board-fsm-55.h: Update. * clk_gpio_init.c (gpio_init): Use VAL_GPIO_LED_*. 2015-06-29 Niibe Yutaka <gniibe@fsij.org> * board/board-cq-starm.h: New for CQ STARM. * clk_gpio_init.c (gpio_init): LED is mandatory, but USB enabler is optional. * board/*.h: Update. 2015-06-22 Niibe Yutaka <gniibe@fsij.org> * clk_gpio_init.c: New, adding ports E/F/G. * entry.c: Include clk_gpio.init.c if not HAVE_SYS_H. * example-led/sys.c: Include clk_gpio_init.c. * example-cdc/sys.c: Ditto. * board/board-stm32-primer2.h: New from Kaz Kojima. 2015-04-20 Niibe Yutaka <gniibe@fsij.org> Merge cortex-m0-support branch. * VERSION: 0.05. * example-led/sys.c (gpio_init): Support MCU_STM32F0. (reset): Support __ARM_ARCH_6M__. * example-led/sample.ld: Change for Cortex-M0. * example-fsm-55/*: New example for FSM-55. * entry.c (STM32_PPRE1, STM32_PLLSRC, STM32_FLASHBITS) (STM32_PLLCLKIN): Support MCU_STM32F0. (struct RCC, RCC_*): Support MCU_STM32F0. (struct SYSCFG) [MCU_STM32F0]: New. (struct GPIO, GPIO*): Support MCU_STM32F0. (clock_init, gpio_init): Support MCU_STM32F0. (hard_fault, vectors_in_ram, entry): Support Cortex-M0. * chopstx.c (chx_cpu_sched_lock, chx_cpu_sched_unlock) (sched, preempt, svc): Support Cortex-M0. * board/board-fsm-55.h: New. * board/board-stm32f0-discovery.h: New. 2015-04-17 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (CHX_PRIO_MAIN_INIT): New, removing CHX_PRIO_MAIN. (chopstx_main_init): New. (chx_init): Use CHX_PRIO_MAIN_INIT. 2015-04-08 Niibe Yutaka <gniibe@fsij.org> * board/board-maple-mini.h: New from Aidan Thornton. 2015-03-17 Niibe Yutaka <gniibe@fsij.org> * VERSION: 0.04a. 2014-12-10 Niibe Yutaka <gniibe@fsij.org> * Version 0.04. * doc/chopstx.texi (VERSION): 0.04. * board/*.h: Updated. * example-cdc/sys.c: Copied from example-led. * example-led/sys.c (clock_init, GPIO_USB): Follow the change of entry.c. (gpio_init): Use RCC_ENR_IOP_EN and RCC_RSTR_IOP_RST. (reset): Use ldr instead of mov.w and movt. * entry.c (GPIO_USB) [GPIO_USB_BASE]: Conditionally defined. * chopstx.c (preempt): Add ! for stm. (chx_exit): Make sure RETVAL is saved onto r8. (chopstx_usec_wait_var): Make sure USEC_P is saved onto r8. 2013-11-27 Niibe Yutaka <gniibe@fsij.org> * board/board-stbee-mini.h: New. * entry.c (AFIO_MAPR_SWJ_CFG_DISABLE): New. 2013-11-26 Niibe Yutaka <gniibe@fsij.org> * board/board-stbee.h: New. * rules.mk (OUTFILES) [ENABLE_OUTPUT_HEX]: Add hex generation. 2013-11-21 Niibe Yutaka <gniibe@fsij.org> * example-cdc/usb_stm32f103.c, example-cdc/usb_lld.h: Update from Gnuk. 2013-11-08 Niibe Yutaka <gniibe@fsij.org> * Version 0.03. * doc/chopstx.texi (VERSION): 0.03. * chopstx.c (preempt): Disable interrupt. 2013-11-08 Niibe Yutaka <gniibe@fsij.org> * Version 0.02. * doc/chopstx.texi (VERSION): 0.02. * example-cdc/usb_stm32f103.c: Updated from NeuG. * chopstx.c (CPU_EXCEPTION_PRIORITY_SYSTICK): Equals to CPU_EXCEPTION_PRIORITY_INTERRUPT. 2013-11-03 Niibe Yutaka <gniibe@fsij.org> * Version 0.01. * doc/chopstx.texi (VERSION): 0.01. * chopstx.c (chx_clr_intr): New. (chopstx_intr_wait): Call chopstx.c. (chx_enable_intr): Let chx_clr_intr clear pending-bit. 2013-11-02 Niibe Yutaka <gniibe@fsij.org> * example-cdc/usb_lld.h, example-cdc/usb_stm32f103.c: Update from Gnuk. * example-cdc/usb-cdc.c (usb_cb_get_descriptor): Follow the change. * example-cdc/sys.c, example-led/sys.c: Update from Gnuk. * chopstx.c (CPU_EXCEPTION_PRIORITY_INTERRUPT) (CPU_EXCEPTION_PRIORITY_PENDSV): Change the value, so that interrupt priority matches USB interrupt priority of old SYS 1.0 implementation. (chx_enable_intr, chx_disable_intr): Clear pending bit at chx_enable_intr. (chopstx_intr_wait): Call chx_enable_intr only when it's going to sleep. * entry.c (RCC_APB2RSTR_AFIORST, define RCC_APB2ENR_AFIOEN): New. (AFIO, GPIO_OTHER): New. (gpio_init): Handle AFIO and GPIO_OTHER. * board/board-fst-01.h, board/board-stm8s-discovery.h: Add pin-cir usage. 2013-08-21 Niibe Yutaka <gniibe@fsij.org> * Version 0.00. * doc: Documentation. * example-led/sys.c: Update from NeuG. * example-cdc/sys.c: Likewise. * example-cdc/usb_stm32f103.c: Likewise. * example-cdc/usb_lld.h: Likewise. * example-cdc/usb-cdc.c: Likewise. 2013-08-19 Niibe Yutaka <gniibe@fsij.org> * rules.mk (%.elf): Support OBJS_ADD. 2013-08-16 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chopstx_usec_wait_var): Check usec_p at the beginning of the loop, bug fix of sched-unlocking from sched-unlocked state. 2013-06-19 Niibe Yutaka <gniibe@fsij.org> * chopstx.h (CHOPSTX_THREAD_SIZE): New. * rules.mk (CSRC): Add eventflag.c. * eventflag.h, eventflag.c: New. * chopstx.c (chopstx_main): New. (chx_init): Initialize chopstx_main. * example-cdc/sample.c (usb_intr): No disable/enable interrupt, but call the handler. 2013-06-13 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chopstx_usec_wait_var): Rename (was: chopstx_usec_wait_internal), as it's user visible. 2013-06-12 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_init): Inhibit preemption for main thread. 2013-06-11 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_timer_expired): Use uint16_t here. (chx_cpu_sched_lock, chx_cpu_sched_unlock): Change only when its priority is lower than CHOPSTX_PRIO_INHIBIT_PREEMPTION. 2013-06-06 Niibe Yutaka <gniibe@fsij.org> * entry.c: Include sys.h for clock_init and gpio_init. * chopstx.c (PREEMPTION_USEC): Fix the value. (sched): Check tp != NULL to see flag_sched_rr. 2013-06-05 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (sched, preempt, svc, chx_timer_expired, chx_exit) (chopstx_usec_wait, chopstx_mutex_lock, chopstx_cond_wait) (chopstx_intr_wait, chopstx_join): Implement SCHED_RR. (chopstx_create): Change API. (chopstx_wakeup_usec_wait): New. (chopstx_usec_wait): Accept wakeup to break. (chopstx_usec_wait_internal): New. (CHX_FLAGS_MAIN): New. (chx_systick_init): Add chx_timer_insert for main. (chx_set_timer): Don't set thread state. (chopstx_usec_wait_internal): Set thread state to THREAD_WAIT_TIME. 2013-06-04 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (AIRCR): New. (chx_init): Setting for PRIGROUP 2-bit:2-bit. (sched): Unlock cpu_sched_lock on return to thread. (preempt, chx_timer_expired, chx_handle_intr): Those can be considered holding cpu_sched_lock (by its equal exception priorities), thus no acquiring lock required. (CHX_PRIO_MAIN): New macro. (chopstx_create): Change API. (chopstx_attr_init, chopstx_attr_setschedparam) (chopstx_attr_setstack): Remove. (chopstx_intr_wait, chopstx_join): Call chx_cpu_sched_unlock. (chopstx_cleanup_push, chopstx_cleanup_pop): New. (chopstx_exit): Call cleanup routines. 2013-06-03 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_spin_lock, chx_spin_unlock): Rename. (chx_cpu_sched_lock, chx_cpu_sched_unlock): New. * chopstx.c (chx_exit): Use R8. 2013-05-29 Niibe Yutaka <gniibe@fsij.org> * entry.c (entry): Initialize data section. * chopstx.c (svc): Implement race avoidance between chx_handle_intr. (chx_handle_intr): Increment ->ready. Put to ready queue only when it's not running. (chx_sched): Add an argument for race avoidance. (chopstx_intr_wait): Fix race condition. (chopstx_cond_broadcast): Fix initial value. (chopstx_join): Check RET. (chx_init): Initialize q_exit and q_join. (chopstx_release_irq, chopstx_release_irq_thread): Enable IRQ on release (as system reset default). * board/board-olimex-stm32-h103.h (NEUG_ADC_SETTING2_*): Add. * chopstx.c (chx_mutex_unlock, chopstx_exit): New. (chopstx_mutex_unlock): Use chx_mutex_unlock. (chopstx_cond_wait): Fix race condition. 2013-05-28 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chopstx_intr_wait): Rename from chopstx_wait_intr. (chopstx_usec_wait): Rename from chosptx_usleep. (chopstx_cancel, chopstx_testcancel): New. (idle): Moved from entry.c and use WFI if USE_WFI_FOR_IDLE. 2013-05-27 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_fatal, chopstx_exit, chopstx_join): New. (struct chx_thread): Independent member of state. Use bit fields. (chx_timer_expired, chx_handle_intr): Check priority before calling chx_request_preemption. (chx_disable_intr): Clear pending interrupt too. (chopstx_claim_irq): Rename from chopstx_intr_register. (chopstx_release_irq): New. (chopstx_join): Promote priority of thread to be joined. 2013-05-24 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_request_preemption): Rename from chx_preempt. * entry.c: "sys.h" is only for to new sys 2.0, keeping compatibility to 1.0, it is if-def out now. 2013-05-22 Niibe Yutaka <gniibe@fsij.org> * chopstx.c (chx_enable_intr, chx_disable_intr): Implement. (chx_set_intr_prio): New. (chx_handle_intr): Use list to register interrupt threads. (chx_init): Set PendSV priority (as minimum: bigger). * entry.c (vector_table): set chx_handle_intr for all interrupts. 2013-05-21 Niibe Yutaka <gniibe@fsij.org> * Initial commit.