Giter VIP home page Giter VIP logo

cyancore's Issues

ADC: Bugs in hal driver

  • wrong bitfields used in line 78 [Replace ADPS with ADTS]
  • bug in line 148, logic is wrongly used [ADIF is set if conversion is done]

FR: Global Timer / sched timer in CC framework

Describe the solution you'd like
Global timer and scheduler timer are required for time stamping and invoking scheduler.
The two timer instance should internally call platform APIs and manage the callbacks.

Fix Assembler macros

Use header file for toolchain agnostic asm macros and
choose the definition file based on the toolchain.

Create a syslog system for cyancore

Syslog shall be a global logging system for the complete system that can be divided into multiple critical levels.

The user shall be provided with the placeholder to write and register callbacks for different logging channels.
Hence when the log function is called all the channels can be populated with the data to be logged simultaneously.

FR: Add linting tool support

Is your feature request related to a problem? Please describe.
There is a need for a tool to perform code check to address most of the compile time boundary cases.

Describe the solution you'd like
Add cppcheck tool to build-engine to auto check all the sources.

Add RISC-V 32I CPU support

Is your feature request related to a problem? Please describe.
Need RISC-V core to the platform.

Describe the solution you'd like
Using Freedom Board E310, the support for CPU and platform will be ported.

FR: Heap memory implementation in CC

Is your feature request related to a problem? Please describe.
For execution of modules that may not be used later, common variables can be part of heap and freed on exit. This saves RO/RW/Bss space.

Describe the solution you'd like
Implement malloc and free.

Console MemBuf & UART HAL Bugs

Describe the bug

  1. (Membuf) "\b" causes memory usage bypassing actual job done by "\b".
  2. (UART HAL) redundant line of code & unnecessary load store operations.

<MegaAVR> Arduino UNO doesn't boot after updating memory org

Describe the bug
Upon debug, it is found that data copy isn't happening properly after the memory organisation was updated. This led to bad data on the ram thereby resulting in boot failure.

To Reproduce
Steps to reproduce the behavior:

  1. Try to boot.

Expected behavior
Boot failure and blank screen if using demo_avr

Minimal Project build fails

Describe the bug
When we try to port minimal project, the build fails giving dependency error on WDT and Console.

To Reproduce
Steps to reproduce the behavior:

  1. cp -a project.template <project_name>
  2. cd <project_name>
  3. clear all flags in config
  4. make <project_name>

Expected behavior
This should be a clean build without any errors. But we face build issues.

Fix driver.c

  • Driver setup function needs to perform driver online check
  • [Thought: Do we need to perform dependency check] Perform recursive init of drivers to resolve dependency
  • Add separate linker script for driver constructor table

Build Support on Windows OS

Is your feature request related to a problem? Please describe.
This feature is needed to build the cyancore software framework on Windows OS.

  • As of now only Linux support is available but because of the paths, build fails even with windows supported toolchain.

Describe the solution you'd like

  • N/A

Describe alternatives you've considered

  • Use VSCode (Remote) with WSL enabled
  • Use Ubuntu 20.04 Terminal
  • Add VSCode plugin to support build and debug
  • Bring in new build engine (!Last escort!)

<MegaAVR> WatchDog support on ATMega328P

Is your feature request related to a problem? Please describe.
This is FR for watchdog driver. As no port for wdt is added on MegaAVR platform, Raising a requirement for the same.

FR: Add IS_ISR() API to depict an ISR context.

Is your feature request related to a problem? Please describe.
Add IS_ISR() API to depict an ISR context.

Describe the solution you'd like
An unified API to tell about current call context to help kernel being non-blocking if the kernel API is being called from ISR context.

/**
  \brief   Get IPSR Register
  \details Returns the content of the IPSR Register.
  \return               IPSR Register value
 */
__STATIC_FORCEINLINE uint32_t __get_IPSR(void)
{
  uint32_t result;

  __ASM volatile ("MRS %0, ipsr" : "=r" (result) );
  return(result);
}
#if    (__ARM_ARCH_7A__      == 1U)
/* CPSR mode bitmasks */
#define CPSR_MODE_USER            0x10U
#define CPSR_MODE_SYSTEM          0x1FU

#define IS_IRQ_MODE()             ((__get_mode() != CPSR_MODE_USER) && (__get_mode() != CPSR_MODE_SYSTEM))
#else
#define IS_IRQ_MODE()             (__get_IPSR() != 0U)
#endif

#define IS_IRQ()                  IS_IRQ_MODE()

BUG: unsigned int is not enough for passing pointers to machine_call

Describe the bug
Using unsigned int means restricting the size to 2 or 4 bytes max which does not comply with pointers which can acquire up-to 8 bytes of space when using pointers. Hence it is a huge vulnerability for inter-arch switch.

Expected behavior
To be able to pass pointers through the mcalls irrespective of any arch.

Workaround
To introduce a user-defined type which switches between the data-type sizes as required.

Eg:

#if defined(ARCH_ARM_32)
#define __CALL_ARG_TYPE__ unsigned long

#elif defined(ARCH_RISCV_64) || defined(ARCH_ARM_64)
#define __CALL_ARG_TYPE__ unsigned long

#else
#define __CALL_ARG_TYPE__ unsigned int

#endif

typedef __CALL_ARG_TYPE__ call_args;

Improve status.h

  1. Improvement of status.h with categorized err codes
  2. Use error_init_done and error_init_not_done to wrap existing driver setup and release.

Bug: Sysclk_set_clk return wrong code upon successful execution

Describe the bug
sysclk_set_clk(<clk_type>, <clk_val>) return wrong code upon successful execution

To Reproduce
Steps to reproduce the behavior:
call function 'printf("%u\n", -sysclk_set_clk(pll, 320e6));'

Expected behavior
Successful programming should return 0.

FR: Update drivers to use malloc

Is your feature request related to a problem? Please describe.
Drivers currently use bss/ro/rw data space for instantiating their port structures. These needs to be moved to heap for optimum use.

Describe the solution you'd like
Use malloc and free to assign and claim space for driver ports.

BUG: <AVR> ADC read n samples may introduce large latency in sampling rate.

For collecting samples at almost machine level of sampling; I.e. without introducing additional delay between 2 samples, our current platform intro uses delay by performing a check for data alignment.

Suggested alternate approach...

  • Consider adding port based flag which can be checked and reduce latency
  • Consider taking number of samples as argument for adc_read function...

FR: Add Cortex M0+ CPU support

Is your feature request related to a problem? Please describe.
Add ARM Cortex M0+ CPU support on Cyancore

Describe the solution you'd like
Using Raspberry PI Pico, port cpu and platform support on cyancore

Fix LibResource.

  • dp to use module array of size = N peripherals
  • Each module element will point to config struct of peripheral
  • Use sp (software properties) to elaborate information on device drivers
  • Flow should be...
    • device driver -> sp -> ret info -> call HAL driver with ID -> dp -> update HAL reg

FR: <MegaAVR> Onchip Temperature sensor support

Is your feature request related to a problem? Please describe.
Onboard temperature sensor readout is needed to monitor system health.

Describe the solution you'd like
Use existing ADC driver for MegaAVR chips and port the support for onboard thermal sensor.

FR: FreeRTOS implementation (Port to cyancore)

Is your feature request related to a problem? Please describe.
Cyancore currently does not have the required support for FreeRTOS

Describe the solution you'd like
FreeRTOS port onto Cyancore Framework

FR: Ability to disable logs and optimize code

Is your feature request related to a problem? Please describe.
When console / memory logger is not being used printf becomes a dead code and increases text size.

Describe the solution you'd like
Set flags internally that disables logs.

Add file headers and document the existing code base

  /**
   * File Name: < 1 Tab > < name >
   * Description: < 1 Tab > < description >
   * < 2 Tab, align to start of description > < descrption-contd. >
   * Primary Author: < align >< name > [< email >]
   * Date: < use tab to align to start of largest subject >< Original Date of creation >
   */
  
   /**
    * < License > ...
    */
  • Add Licenses to every file and framework.
  • Document code and add function headers
   /**
    * <Function name> - 1 Liner description 
    * <Full Description >
    * <arg0>
    * <arg1>
    * ...
    * <return>
    */

<AVR> Perform check for reset cause

In the init routine of the cpu perform check for reset cause. This is necessary to select boot flow so that system can take necessary action.


This is still under brainstroming... May take up some time before I come up with definitive solution.

This is a critical enhancement update for the cyancore framwork.

FR: Apps library creation support

Need for this feature: in future, apps will be required to be created on cyancore. For this we need library which can perform calls to each layer independently.

Milestone: Assigning no milestone as of now... Let's keep patching the code base.

Add function headers for all the functions

For the sake of better user experience add function headers that provides information about the function.

Sample:

/************************************************************************************************************
 * @brief:    <add a brief about the function>
 * 
 * @param[in]      <input parameter name>    <description of the param>
 * @param[out]     <output parameter name>    <description of the param>
 * 
 * @return         <brief about expected returns or error codes>
 ************************************************************************************************************/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.