SDA Ethernet encapsulation with chatGPT o1 (part 2)
This is a continuation of the first post on SDA Ethernet encapsulation. In this post we explore reducing the complexity of the module produced and using chatGPT o1 with reasoning. Results are better but are still lacking. The modules still need correction and analysis at a system level for the module.
SDA Ethernet encapsulation with ChatGPT o4
In this post I explore some of the coding shortcomings of ChatGPT o4. I try to have it code a VHDL module for Ethernet encapsulation based on it reading the SDA specification. As I point out some of the failings it tries to correct the code but also introduces more errors.
Thirty-year coding veteran vs AI
A thirty-year coding veteran experiments with ChatGPT (GPT-3 and GPT-4) to help implement a VHDL RGMII-to-GMII converter and a 4x oversampling scheme. The post recounts iterative Q&A with the model, shows example VHDL snippets GPT produced, and highlights concrete mistakes the AI made — most notably failing to implement DDR semantics correctly, providing a broken majority-vote function, and overlooking timing/clock-domain nuances. The author concludes that AI can produce useful scaffolding and debugging clues but repeatedly requires careful inspection, simulation, and domain knowledge to correct subtle protocol and timing errors before trusting generated hardware code for real designs.
Why use Area under the curve? (AUC - ROC)
In scenarios with imbalanced datasets, ROC curves and AUC-ROC scores are valuable tools for assessing and comparing the performance of machine learning classifiers. They help provide insights into a model's ability to distinguish between classes and can guide decision-making regarding threshold selection.
Machine Learning Models Basic Performance Metrics
When analyzing data using ML, a suitable model is selected based on the task. Classifier models learn from labeled training data and predict discrete classes, while regression models learn from training data and predict continuous values. To evaluate the performance of machine learning models, various metrics are used. These include accuracy, precision, recall, F1 score, AUC-ROC, MAE, MSE, and R-squared. The choice of metrics depends on the specific problem and the nature of the data. Visualization tools such as confusion matrices, ROC curves, precision-recall curves and others can be used to gain insights into the performance of classifiers and understand their behavior. When dealing with imbalanced data, using accuracy as an evaluation metric can be misleading. Accuracy does not account for class imbalance, it may overestimate the performance. It is important to consider other metrics such as AUC and others which provide a more comprehensive evaluation performance in imbalanced datasets.
3 Tips for using ChatGPT for Embedded Software
The post presents three practical tips for using ChatGPT to accelerate embedded software development. It demonstrates how the model can gather background information and suggest API designs, illustrated by an LED class API example, and how it can produce baseline C++ code including an abstract LED class and an STM32 HAL-derived implementation. The author emphasizes that generated code is often a helpful starting point—roughly 80% useful—but requires style adjustments, parameter qualifications, and integration work. The post also warns that ChatGPT can be inconsistent and occasionally incorrect, so developers must validate, test, and refine prompts to get reliable results. The conclusion positions ChatGPT as a productivity aid rather than a replacement for engineering judgment.
TensorFlow Datasets
This article explains how TensorFlow Datasets (TFDS) work and how to create custom datasets for public or private sharing. It describes three common scenarios—publishing a dataset publicly, modifying an existing public dataset, and sharing datasets within an organization—and highlights TFDS's goal to automate downloading and preparing data in a TensorFlow-ready on-disk format. The piece walks through using tfds.load to access catalog datasets (e.g., MNIST, OxfordIIITPet), installing the tensorflow-datasets package, and using the TFDS CLI to scaffold a GeneratorBasedBuilder subclass. It details the required methods (_info, _split_generators, _generate_examples) and best practices such as using the download manager and controlling data_dir, concluding that TFDS simplifies reproducible dataset distribution and preparation.
How to Architect a TinyML Application with an RTOS
This post explains how to integrate TinyML into RTOS-based embedded systems by using a data-flow-driven architecture and task decomposition. It recommends separating hardware-dependent and hardware-independent layers, placing the ML runtime (e.g., TensorFlow Lite for Microcontrollers) in its own RTOS task, and grouping related input processing—such as filtering and feature extraction—into tasks that reflect timing needs. The article discusses inter-task data-sharing mechanisms (shared memory with mutexes or queues), how to assign task priorities and periods to meet real-time constraints, and why acting on outputs at the start of a task reduces jitter. It concludes that an RTOS adds flexibility and scalability for TinyML applications with minimal changes beyond adding a runtime task and supporting modules.
Is Machine Learning Ready for Microcontroller-based Systems?
The post examines the practicality of deploying machine learning on microcontroller-based systems, weighing use cases, tooling, and limitations. It identifies feasible applications—keyword spotting for voice wake words, lightweight image classification (e.g., OpenMV on STM32H7), and simple predictive maintenance via anomaly detection—while noting that on-device adaptive training remains infeasible for most MCUs. The article surveys available tooling such as TensorFlow Lite for Microcontrollers, ST’s X-CUBE-AI, NanoEdgeAiStudio, and Edge Impulse that help train, optimize, and deploy compact models. It concludes that ML on microcontrollers is conditionally ready: viable for many constrained inference tasks today but requiring trade-offs in accuracy, memory, and latency and careful MCU/toolchain selection as the ecosystem matures.
A New Related Site!
The post announces the launch of MLRelated, a new Related site dedicated to machine learning and deep learning. It positions MLRelated as complementary to existing Related sites by highlighting cross-cutting interests: TinyML for embedded developers, machine/deep learning applications in signal processing, and FPGA-based AI/ML implementations. The new site debuts with a modest amount of content and is expected to expand rapidly through contributions from the Related community in the form of blogs, forum threads, and webinars. The author invites readers to report navigation errors, share feedback, and propose ideas to help steer MLRelated into a practical, community-driven resource for researchers and practitioners in ML and adjacent domains.
A New Related Site!
The post announces the launch of MLRelated, a new Related site dedicated to machine learning and deep learning. It positions MLRelated as complementary to existing Related sites by highlighting cross-cutting interests: TinyML for embedded developers, machine/deep learning applications in signal processing, and FPGA-based AI/ML implementations. The new site debuts with a modest amount of content and is expected to expand rapidly through contributions from the Related community in the form of blogs, forum threads, and webinars. The author invites readers to report navigation errors, share feedback, and propose ideas to help steer MLRelated into a practical, community-driven resource for researchers and practitioners in ML and adjacent domains.
TensorFlow Datasets
This article explains how TensorFlow Datasets (TFDS) work and how to create custom datasets for public or private sharing. It describes three common scenarios—publishing a dataset publicly, modifying an existing public dataset, and sharing datasets within an organization—and highlights TFDS's goal to automate downloading and preparing data in a TensorFlow-ready on-disk format. The piece walks through using tfds.load to access catalog datasets (e.g., MNIST, OxfordIIITPet), installing the tensorflow-datasets package, and using the TFDS CLI to scaffold a GeneratorBasedBuilder subclass. It details the required methods (_info, _split_generators, _generate_examples) and best practices such as using the download manager and controlling data_dir, concluding that TFDS simplifies reproducible dataset distribution and preparation.
How to Architect a TinyML Application with an RTOS
This post explains how to integrate TinyML into RTOS-based embedded systems by using a data-flow-driven architecture and task decomposition. It recommends separating hardware-dependent and hardware-independent layers, placing the ML runtime (e.g., TensorFlow Lite for Microcontrollers) in its own RTOS task, and grouping related input processing—such as filtering and feature extraction—into tasks that reflect timing needs. The article discusses inter-task data-sharing mechanisms (shared memory with mutexes or queues), how to assign task priorities and periods to meet real-time constraints, and why acting on outputs at the start of a task reduces jitter. It concludes that an RTOS adds flexibility and scalability for TinyML applications with minimal changes beyond adding a runtime task and supporting modules.
3 Tips for using ChatGPT for Embedded Software
The post presents three practical tips for using ChatGPT to accelerate embedded software development. It demonstrates how the model can gather background information and suggest API designs, illustrated by an LED class API example, and how it can produce baseline C++ code including an abstract LED class and an STM32 HAL-derived implementation. The author emphasizes that generated code is often a helpful starting point—roughly 80% useful—but requires style adjustments, parameter qualifications, and integration work. The post also warns that ChatGPT can be inconsistent and occasionally incorrect, so developers must validate, test, and refine prompts to get reliable results. The conclusion positions ChatGPT as a productivity aid rather than a replacement for engineering judgment.
Machine Learning Models Basic Performance Metrics
When analyzing data using ML, a suitable model is selected based on the task. Classifier models learn from labeled training data and predict discrete classes, while regression models learn from training data and predict continuous values. To evaluate the performance of machine learning models, various metrics are used. These include accuracy, precision, recall, F1 score, AUC-ROC, MAE, MSE, and R-squared. The choice of metrics depends on the specific problem and the nature of the data. Visualization tools such as confusion matrices, ROC curves, precision-recall curves and others can be used to gain insights into the performance of classifiers and understand their behavior. When dealing with imbalanced data, using accuracy as an evaluation metric can be misleading. Accuracy does not account for class imbalance, it may overestimate the performance. It is important to consider other metrics such as AUC and others which provide a more comprehensive evaluation performance in imbalanced datasets.
SDA Ethernet encapsulation with chatGPT o1 (part 2)
This is a continuation of the first post on SDA Ethernet encapsulation. In this post we explore reducing the complexity of the module produced and using chatGPT o1 with reasoning. Results are better but are still lacking. The modules still need correction and analysis at a system level for the module.
Why use Area under the curve? (AUC - ROC)
In scenarios with imbalanced datasets, ROC curves and AUC-ROC scores are valuable tools for assessing and comparing the performance of machine learning classifiers. They help provide insights into a model's ability to distinguish between classes and can guide decision-making regarding threshold selection.
Thirty-year coding veteran vs AI
A thirty-year coding veteran experiments with ChatGPT (GPT-3 and GPT-4) to help implement a VHDL RGMII-to-GMII converter and a 4x oversampling scheme. The post recounts iterative Q&A with the model, shows example VHDL snippets GPT produced, and highlights concrete mistakes the AI made — most notably failing to implement DDR semantics correctly, providing a broken majority-vote function, and overlooking timing/clock-domain nuances. The author concludes that AI can produce useful scaffolding and debugging clues but repeatedly requires careful inspection, simulation, and domain knowledge to correct subtle protocol and timing errors before trusting generated hardware code for real designs.
Is Machine Learning Ready for Microcontroller-based Systems?
The post examines the practicality of deploying machine learning on microcontroller-based systems, weighing use cases, tooling, and limitations. It identifies feasible applications—keyword spotting for voice wake words, lightweight image classification (e.g., OpenMV on STM32H7), and simple predictive maintenance via anomaly detection—while noting that on-device adaptive training remains infeasible for most MCUs. The article surveys available tooling such as TensorFlow Lite for Microcontrollers, ST’s X-CUBE-AI, NanoEdgeAiStudio, and Edge Impulse that help train, optimize, and deploy compact models. It concludes that ML on microcontrollers is conditionally ready: viable for many constrained inference tasks today but requiring trade-offs in accuracy, memory, and latency and careful MCU/toolchain selection as the ecosystem matures.
SDA Ethernet encapsulation with ChatGPT o4
In this post I explore some of the coding shortcomings of ChatGPT o4. I try to have it code a VHDL module for Ethernet encapsulation based on it reading the SDA specification. As I point out some of the failings it tries to correct the code but also introduces more errors.
A New Related Site!
The post announces the launch of MLRelated, a new Related site dedicated to machine learning and deep learning. It positions MLRelated as complementary to existing Related sites by highlighting cross-cutting interests: TinyML for embedded developers, machine/deep learning applications in signal processing, and FPGA-based AI/ML implementations. The new site debuts with a modest amount of content and is expected to expand rapidly through contributions from the Related community in the form of blogs, forum threads, and webinars. The author invites readers to report navigation errors, share feedback, and propose ideas to help steer MLRelated into a practical, community-driven resource for researchers and practitioners in ML and adjacent domains.
3 Tips for using ChatGPT for Embedded Software
The post presents three practical tips for using ChatGPT to accelerate embedded software development. It demonstrates how the model can gather background information and suggest API designs, illustrated by an LED class API example, and how it can produce baseline C++ code including an abstract LED class and an STM32 HAL-derived implementation. The author emphasizes that generated code is often a helpful starting point—roughly 80% useful—but requires style adjustments, parameter qualifications, and integration work. The post also warns that ChatGPT can be inconsistent and occasionally incorrect, so developers must validate, test, and refine prompts to get reliable results. The conclusion positions ChatGPT as a productivity aid rather than a replacement for engineering judgment.
How to Architect a TinyML Application with an RTOS
This post explains how to integrate TinyML into RTOS-based embedded systems by using a data-flow-driven architecture and task decomposition. It recommends separating hardware-dependent and hardware-independent layers, placing the ML runtime (e.g., TensorFlow Lite for Microcontrollers) in its own RTOS task, and grouping related input processing—such as filtering and feature extraction—into tasks that reflect timing needs. The article discusses inter-task data-sharing mechanisms (shared memory with mutexes or queues), how to assign task priorities and periods to meet real-time constraints, and why acting on outputs at the start of a task reduces jitter. It concludes that an RTOS adds flexibility and scalability for TinyML applications with minimal changes beyond adding a runtime task and supporting modules.
TensorFlow Datasets
This article explains how TensorFlow Datasets (TFDS) work and how to create custom datasets for public or private sharing. It describes three common scenarios—publishing a dataset publicly, modifying an existing public dataset, and sharing datasets within an organization—and highlights TFDS's goal to automate downloading and preparing data in a TensorFlow-ready on-disk format. The piece walks through using tfds.load to access catalog datasets (e.g., MNIST, OxfordIIITPet), installing the tensorflow-datasets package, and using the TFDS CLI to scaffold a GeneratorBasedBuilder subclass. It details the required methods (_info, _split_generators, _generate_examples) and best practices such as using the download manager and controlling data_dir, concluding that TFDS simplifies reproducible dataset distribution and preparation.
Thirty-year coding veteran vs AI
A thirty-year coding veteran experiments with ChatGPT (GPT-3 and GPT-4) to help implement a VHDL RGMII-to-GMII converter and a 4x oversampling scheme. The post recounts iterative Q&A with the model, shows example VHDL snippets GPT produced, and highlights concrete mistakes the AI made — most notably failing to implement DDR semantics correctly, providing a broken majority-vote function, and overlooking timing/clock-domain nuances. The author concludes that AI can produce useful scaffolding and debugging clues but repeatedly requires careful inspection, simulation, and domain knowledge to correct subtle protocol and timing errors before trusting generated hardware code for real designs.
Is Machine Learning Ready for Microcontroller-based Systems?
The post examines the practicality of deploying machine learning on microcontroller-based systems, weighing use cases, tooling, and limitations. It identifies feasible applications—keyword spotting for voice wake words, lightweight image classification (e.g., OpenMV on STM32H7), and simple predictive maintenance via anomaly detection—while noting that on-device adaptive training remains infeasible for most MCUs. The article surveys available tooling such as TensorFlow Lite for Microcontrollers, ST’s X-CUBE-AI, NanoEdgeAiStudio, and Edge Impulse that help train, optimize, and deploy compact models. It concludes that ML on microcontrollers is conditionally ready: viable for many constrained inference tasks today but requiring trade-offs in accuracy, memory, and latency and careful MCU/toolchain selection as the ecosystem matures.
Machine Learning Models Basic Performance Metrics
When analyzing data using ML, a suitable model is selected based on the task. Classifier models learn from labeled training data and predict discrete classes, while regression models learn from training data and predict continuous values. To evaluate the performance of machine learning models, various metrics are used. These include accuracy, precision, recall, F1 score, AUC-ROC, MAE, MSE, and R-squared. The choice of metrics depends on the specific problem and the nature of the data. Visualization tools such as confusion matrices, ROC curves, precision-recall curves and others can be used to gain insights into the performance of classifiers and understand their behavior. When dealing with imbalanced data, using accuracy as an evaluation metric can be misleading. Accuracy does not account for class imbalance, it may overestimate the performance. It is important to consider other metrics such as AUC and others which provide a more comprehensive evaluation performance in imbalanced datasets.
Why use Area under the curve? (AUC - ROC)
In scenarios with imbalanced datasets, ROC curves and AUC-ROC scores are valuable tools for assessing and comparing the performance of machine learning classifiers. They help provide insights into a model's ability to distinguish between classes and can guide decision-making regarding threshold selection.
SDA Ethernet encapsulation with chatGPT o1 (part 2)
This is a continuation of the first post on SDA Ethernet encapsulation. In this post we explore reducing the complexity of the module produced and using chatGPT o1 with reasoning. Results are better but are still lacking. The modules still need correction and analysis at a system level for the module.
SDA Ethernet encapsulation with ChatGPT o4
In this post I explore some of the coding shortcomings of ChatGPT o4. I try to have it code a VHDL module for Ethernet encapsulation based on it reading the SDA specification. As I point out some of the failings it tries to correct the code but also introduces more errors.
A New Related Site!
The post announces the launch of MLRelated, a new Related site dedicated to machine learning and deep learning. It positions MLRelated as complementary to existing Related sites by highlighting cross-cutting interests: TinyML for embedded developers, machine/deep learning applications in signal processing, and FPGA-based AI/ML implementations. The new site debuts with a modest amount of content and is expected to expand rapidly through contributions from the Related community in the form of blogs, forum threads, and webinars. The author invites readers to report navigation errors, share feedback, and propose ideas to help steer MLRelated into a practical, community-driven resource for researchers and practitioners in ML and adjacent domains.







