And I would like to welcome them, Lelana, School of Public Health University of Toronto. So it's also a scientist in the Division of Healthcare and Outcomes Research and the Arthritis Program Research Institute and Assistant Professor at the Dalai Lama School. They share research interests in understanding the personal and population impact of muscle skeletal disorders, particularly osteoarthritis to the analysis of population based as well as clinical data. So I'd like to welcome our distinguished speakers. I will go ahead and turn it over to begin the webinar. Hello, thank you and welcome all of you. This is Badly speaking. If you're here for me, so Lisa, that's my alternative name. So don't be confused, there's not three of us here. There's just two of us and I'm sitting here with Anthony. I'm going to start and then I'm going to hand over to Anthony and then we will come back to me again. Okay, and I just got to work out how to change this slide. Okay, so our general objective in this webinar is to present some preliminary findings of our work in progress and perhaps indicate a little bit where we're going next. And also to suggest areas where further development of the CLSA questionnaires are required. These are sort of areas where we've sort of said, well, I wish they'd done that. So we will be moving on in that area. And but first of all, we're going to be using data from the baseline CLSA data. And just to remind you, it's a population aged 45 to 85. And we're using questionnaire data, the self-report questionnaire data from the tracking sample and the comprehensive sample and wherever possible, you'll see that we've combined the two. So first of all, arthritis. So what is arthritis? Technically, arthritis means inflammation of the joint. But this term is generally used for a family related conditions which affect the joints, such as components of the joints, sort of like the synovium and cartilage, and associated structures, such as ligaments, tendons, and underlying bones. What these family conditions have in common is that they cause pain, swelling, and stiffness in the joints. And one complication of studying arthritis is there's over 100 different conditions. So this slide lists some of the major types of arthritis. The most common type of arthritis by far is osteoarthritis, which has a population prevalence of at least 14% and probably a lot higher. Gout is another form of arthritis. Ex-mainly men with a prevalence of about 4%. The types of arthritis we perhaps hear most about, things like rheumatoid arthritis, belong in the category of inflammatory arthritis, which has a whole bunch of conditions, inflammatory rheumatoid, reactive arthritis, anchors, and spondylitis, and taken together, these have a prevalence of about 1% to 2%. But tend to be some more seriously disabling. And then there are connected tissue diseases, such as systemic lupus, erythematosis, which have a prevalence of about 1.01%, 1 in 1,000. We're going to be talking mainly about osteoarthritis in this talk. So osteoarthritis is characterised by deterioration in the cartilage and other structures in one or more joints. And this deterioration and the problem with other joints, including some inflammation, needs to joint damage, to pain and stiffness in the joint. And osteoarthritis typically affects the knees, spine, hands, hips, and feet. Osteoarthritis is important not because, not only because of its high frequency in the population, it's often written off as fairly minor complaints, but it is a major cause in the population of pain and disability, and through the pain and disability affecting the life of self-care, mobility, employment. And through this, it has an impact on quality of life. It has substantial impact on healthcare utilisation. It's one of the most common conditions consulted for in primary care, and is an important cause of hospitalisation, particularly the surgery for hip and knee joint replacements. And taken together, these create an economic burden to society where actually most of the burden is in indirect cost due to lost productivity and cost to the individual. It's often those of us relatively benign and not associated with mortality, but recent research is showing that osteoarthritis is associated with an increased risk of mortality, particularly from heart disease. And in a way, we're almost beginning to think of it as a sort of separate risk factor for heart disease, a neglected one. So it is an important condition. And I'm going to hand over now to Antoni to talk about the etiology. Good afternoon, everyone. So when we look at the etiology of osteoarthritis, it's been traditionally characterised as a wear and tear condition with joint damage predominantly caused by mechanical factors. So overloading of the joints in quotes, overuse of joints. So the typical diagram of the etiology of osteoarthritis has looked something like this. So recognising that older age and female sex is associated with osteoarthritis. Studies and genetics have really been inconsistent. But a focus on the local environment and mechanical factors, so such as obesity leading to overloaded joints, this leading then to altered joint loading and a cascade down to osteoarthritis in the joint. With that said, however, we know that OA is associated with obesity, particularly the knee, which is a load bearing joint. But we also know that obesity is associated with hand OA, so a non-load bearing joint. We also know from epidemiological studies that it appears that individuals with OA have a higher prevalence of specific conditions compared to non-OA populations. And these include hypertension, heart disease and diabetes. In addition, we know that many people with osteoarthritis have OA in more than one joint, load bearing and non-load bearing joints. And so recognising this, the characterization of OA has changed so that it is now viewed as a heterogeneous condition. That in addition to mechanical etiology also has a metabolic or a systemic etiology. So the diagram now looks something like this with the inclusion of systemic factors in there and in particular inflammation and obesity. So the common pathology that we see in the middle of this diagram can have different ideological pathways. So once you transition to osteoarthritis in the population and some of the challenges that we have had, Lisa has already mentioned that there are many different types of arthritis, with OA being the most common. But the problem is that the most population-based health surveys focus on arthritis in general. And this has made it somewhat difficult to be able to distinguish between individuals with different ideological profiles. As well, I've said that individuals with OA can have OA in multiple joints. However, most of the epidemiological research in OA has focused on individual joints. And most commonly this has been the knee. So the special feature of the CLSA study is that it asks about OA specifically in individual joints. And in this case, the knee, the hip, and the hand. And in addition, questions are asked about joint-specific symptoms. So we believe that the CLSA offers the potential for us to look at some unique insights into OA that has not been possible with other health surveys in Canada. So against the backdrop that osteoarthritis is often perceived as an inevitable condition of aging, our goal was to understand the impact of osteoarthritis across the AIDS ranges in the CLSA. And with this in mind, our objectives were to document the prevalence of osteoarthritis, to investigate the relationship between OA, obesity, and what we are calling here metabolic comorbidities, and to document the prevalence of pain and disability in OA of the knee, hip, and hand. So the CLSA, sorry, asked participants whether a doctor had ever told them that they had osteoarthritis in the knee, in the hip, or in the hand, whether they had rheumatoid arthritis, or any other type of arthritis. For this presentation, when we talk about individuals with osteoarthritis, we're referring to individuals that responded yes to any of the knee, hip, or hand OA questions. As well, whether or not individuals reported having arthritis, they were also asked about joint symptoms during the past four weeks. So for the knee and the hip, individuals were asked about pain on most days and pain on activity, in addition to as much swelling in the knee for those individuals. For the hand, individuals were asked during the past four weeks whether they had pain in the smaller joints, the tips of the fingers, and in the base of the thumb, which we know is always quite common. There were two separate questions asked of individuals who reported, or sorry, I have to report about hand symptoms, number three and number four. Three and four for the hand were not included for what we later call symptomatic OA. So symptomatic OA here was based on all of the questions for the knee and the hip, and number one and two for the hand. So some of our findings. Osteoarthritis was certainly one of the more common conditions in this population. 26% of the CLSA respondents reported having osteoarthritis. So more than three and a half million Canadians reporting have osteoarthritis in the 45 to 85 year age group. We know that this isn't underestimates. The questions here were specific to the knee, the hip, and the hand. There were no questions about back osteoarthritis, shoulder osteoarthritis, or any other joint. For that matter, foot OA, which we know can be quite common in women. So certainly an underestimate. The prevalence of osteoarthritis is higher in women than in men, and this is common across age groups. The prevalence increases with age, and it has been this increase that has really led to that perception that osteoarthritis is a disease of older age. But what we have included here in these graphs is green line that shows the number of people with osteoarthritis. The majority of individuals reporting a diagnosis of osteoarthritis are in fact below the age of 65. And so I think that you can appreciate the implications of these individuals living 20, 30, 40 years with this painful and disabling condition. We have included here similar graphs, one based on the comprehensive sample, the other on the tracking sample. The point here was simply to show how very similar the findings were from an OA perspective. And so for the most part, the rest of the presentation looks at the pooled sample. I indicated that individuals with osteoarthritis can have OA in multiple joint sites. We see this in the CLSA as well. One third of individuals reporting osteoarthritis had it in more than one joint. The reporting of multi-site OA was common across age groups. You'll see even within the youngest age group that one fifth of individuals with osteoarthritis indeed had OA in multiple sites. If we break this down further by OA duration, we still see that irrespective of age, multi-site OA is common and irrespective of duration so that even in those individuals with a recent diagnosis and in the younger age groups, multi-site OA is common. So I introduced the OA obesity and metabolic triad, if you will, and the speculation that OA may have a systemic etiology. And if so, we hypothesized that the relationship between obesity and osteoarthritis would be stronger for those individuals with multi-joint versus single-site OA, that a higher proportion of those with multi-joint osteoarthritis would have what we are calling here metabolic syndrome-associated comorbidities, so hypertension, heart disease and diabetes. And that respondents with osteoarthritis would have a greater likelihood of having these metabolic-associated comorbidities compared to individuals who do not report a diagnosis of OA. Looking at the prevalence of obesity, the prevalence certainly higher in those individuals reporting multi-site compared to single-site osteoarthritis. Again, you'll see that this is the case across age ranges. When we look at the prevalence of these conditions that we are sort of labeling metabolic conditions, higher prevalence in those individuals reporting multi-site OA versus single-site OA. And what we've included as well here is the prevalence of these three conditions in the non-OA population. And so you'll certainly see that the prevalence is higher in those individuals with osteoarthritis. We recognize that there are going to be age distribution differences and obesity distribution differences between these groups. So what we did is we looked at using a Poisson regression analysis, looking at the outcome here is reporting a diagnosis of osteoarthritis versus not, looking at a number of factors that have been identified or have been postulated to be associated with osteoarthritis. The regression here adjusts for education, household income, smoking status, and alcohol consumption, but these are not shown here. So rather women, more likely than men to report a diagnosis of OA, increasing age, more likely to report a diagnosis of OA as we expected. Individuals who are overweight and obese, more likely to report a diagnosis of osteoarthritis. Looking at those metabolic conditions that we were interested in, the more of these metabolic conditions that were reported, the more likely an individual reported a diagnosis of osteoarthritis. And in addition, the reporting of other chronic conditions, also associated with an increased likelihood of reporting a diagnosis of OA. When we looked at the sub-sample of individuals with osteoarthritis, in the CLSA, with an interest in looking at multiple versus single site OA, women, more likely than men to report multi-site versus single site disease. For the age groups, compared to the youngest age group, older individuals are more likely to report multi-site OA. But notice here that the estimates are, in fact, quite stable across the age groups. So there wasn't very much a difference between age groups in the likelihood of reporting multiple versus single site OA. Individuals who are obese, more likely to report multiple versus single site OA. We did not find a statistically significant difference for the metabolic conditions and multi-site OA, although we certainly saw the increasing trend with increasing metabolic conditions. I wanna point out here that the sample size has been reduced compared to the previous slide that we showed you. So that, for instance, the metabolic conditions here, that three category, only 3% of individuals with OA reside in that category. So I mean, it was not unexpected that we would not find something statistically significant with the caveat as well that this is a sort of a crude representation of metabolic syndrome. And this certainly is something that would need to be refined and I know Lisa is gonna touch on this a bit in the later slide. And again, individuals with more chronic conditions were more likely to report multiple site OA versus single site. And I apologize for that to mention that these were also adjusted by SCS status and smoking and alcohol. So at this point, I'll turn this in back to Lisa to talk about the impact of OA. Okay, well, we, as Anthony, well, there's a question on symptomatic OA in the past four weeks. These are people with any size of OA who report symptoms in the joints in the last four weeks. And overall, 70% of respondents had symptoms in the last four weeks. And as perhaps might be expected, respondents with more than one joint site were more likely to have symptomatic OA. But the thing I really want to point out is this does not differ by age. For both one site and multi site OA, the proportion report of symptomatic OA is similar. So it doesn't look like that you get away as a young person and it's fairly trivial. And if you get older, it gets worse. If you have OA, you have OA. And it doesn't really matter how old you are. If you're in that 45 to 54 age group, you'll have OA. You're on average going to be as likely to be symptomatic as somebody who's 85 to 85. The other thing I want to point out because it will become important later is in that more than one site, 90% of the population have symptomatic OA. So it seems that having a way is an indicator of sort of more general severity which would sort of kind of fit in with the metabolic hypothesis. As well as asking questions about symptomatic OA, the CLSA asking general paying questions to all respondents. And these are the same questions that we're asking the Canadian Community Health Survey. So the STEM question is, are you usually free of pain or discomfort? And for those people who said no, pain severity was asked in a supplementary question. How would you describe the usual intensity of your pain or discomfort? Would you say it's more or more severe? And then limitation in activities if pain was assessed by asking whether pain or discomfort limited a non a few or some or most activities. So looking now at the impact, the answers to these questions in our OA population, we find as we joint sentence, pain has little experience in the influence of pain and the experience of pain in people with OA. And these slides that I'm showing you now are looking at pain only in people with OA, not with other conditions. Overall, 60% of the population have at least some pain, some general pain. This is not attributed to OA and arguably most of it might be OA, but we don't know. I also want to point out that the overall presence of pain in the overall population was 70%. So it's a little bit lower. So people with OA who have pain in their joints are not necessarily reporting general pain, which is something we found actually in other studies. When we look at symptomatic or non-symptomatic OA, people with symptomatic OA are lightened and higher prevalence can report pain, but even in people with non-symptomatic OA, about 40% are reporting pain. It could be due to other conditions, but likely some of it is to be brought to OA. When we look at the prevalence, respondents reporting pain by side of OA, we find that more than one site more likely to report pain. And I just want to point out here, 90% of the group with more than one site OA had symptomatic OA, and we're finding 80% or less of the population in this particular group report report any kind of general pain. So there's a bit of a discordance here. Once again, there's no age gradient. So it's not that OA gets more severe over time as you get older. If you have OA, you have pain for joints. As I indicated, there was a companion question asking about limitation in carrying out activities due to pain. This is a proportion just under 60% to report any kind of limitation on carrying out activities due to pain. I think it's actually more than a few limitations. It's once again flat with age. And when we actually look at multi-site OA and symptomatic OA, we see the same kind of patterns as we found for severity of pain. So I will not go to those in detail. So turning now to difficulty with activities. Participants in the tracking sample and in the tracking sample only were asked about the difficulties in 14 basic activities. They also said that they couldn't do these activities or the doctor had ordered them not to do them. This is only a minority and for the purposes of these slides, we've coded these people as having difficulty. So these are the top 10 of the 14 activities which people report difficulty with. The most frequent one was stooping, crouting or kneeling downward where more than half of respondents with OA reported difficulty. If you think this is something you perhaps don't do very often, let me just think about putting your socks on, feeding your pet, thinking something off the floor. We probably do this far more than we ever think we do.  And so if you have OA more than, almost half of you would have, well, 40% of you would have had some difficulty in doing this. Other activities were standing for long periods. For example, activities using the upper limb and you're using the hand arm or something to do things like grip or whole things seems to involve forces of the joints and walking up and down stairs or some problem as well as walking and mobility in general. And overall 76, three quarters of the population with OA reported having a difficulty with at least one of these and over half had more than two difficulties. And when we look by age, we see that the proportion, once again similar, paralleling the results to pain who have more than two difficulties is similar for each age group and people with one site OA have a slightly less likely to report difficulty than people having OA and more than one site. Activities in daily living were asked about in both the tracking sample and comprehension sample and we're combining majorly when people were asked about activities of daily living and instrumental activities of daily living that they could carry out without help with help or not at all. And this is, this fraternel is actually the mostly older American resources and service multi-dimensional functional assessment. And I will point out that it is being used for people who are 45 to 65. So not all this population is not by no means older population. These are some of the items in the questionnaire. The response options were help except for one item shown at the bottom of the slide which is trouble getting to the bathroom on time. And this was just a yes-no question. Do you have a trouble getting to the bathroom on time? And in fact, this was the activity that was reported most often where almost a fifth of the people with OA reported trouble getting to the bathroom on time. And trouble is more like the question on difficulty. So what we did was take this question out and insert it into the questions that we've already seen about difficulties with daily activities. And you can see on the slide shown by the pink arrows in the dark bar. This is where this activity fits in the people who have difficulty. So it would be in the top 10 of difficulties of people with OA. And it's something, in fact, when we think about mobility difficulties, it's something we often don't actually think about one of the most crucial reasons we might have for mobility is perhaps to get to bathroom on time. And this is substantial problem in people with OA. So this shows the, the next slide here shows the propulsion with all the difficulty in all these activities. You can see getting to the bathroom on time, the FNL question about trouble stands out. So what I've done in the next, I've gone to it out so we can look at the questions which report needing help. And the most frequent activity where people report needing help is doing housework. But we should also remember in fact that this is one of the activities for which it's perhaps most culturally or acceptable to ask for help or have somebody to do help. And I imagine that many people, many of you now here, actually probably pay somebody to do your housework for you. I certainly do as I was answering. So sometimes getting help in housework is a survival activity for people. So doing housework was the most frequently reported and all the other activities were reported by less than 5% of the population in terms of needing help. And if you would, can you contrast in this in your mind with the high proportion of people who had difficulty doing activities, including difficulties like that wouldn't be involved in things like walking and shopping and taking a bath? And also the high proportion of the population who reported pain because of their astro-modernity. And I'll return back to this later. So 14% overall, 14% of the population reported needing help or being able to do one of these activities. And if we exclude housework, it's 8%. So any of minority. Well, let me actually look at how this relates to the, if you like, severity of OA in terms of whether they have one site or multiple site OA. We see that those people with multiple site OA are given more severe OA or more likely to need help. And excluding the oldest age group where we slightly have a lot of comorbidity and frailty and things. Once again, there was no very little age gradient. And even these 40, and with the 45 to 64 age group to being just as likely to need help with at least one ADL as people in the older age groups. So in summary, in the population, the majority of people with OA are below the age of 65. So we can't discount this as being purely a disease of the elderly, a normal part of getting old and something that you just have to put up with an old age because that's what you get in old age. They are a substantial portion of people here who are 45 to 64. There is some evidence for a metabolic systemic component to OA. However, how we conceptualize metabolic syndrome here is very proved. We just looked at obesity in three particular conditions. We're aware that the comprehensive sample has some biologic measures and one of our future plans is to add to our results here by including the biologic measures, particularly looking at waist-to-hip ratio as well as obesity. And I can tell you that the results are pretty much the same. And also actually looking at some of the blood values, looking at cholesterol and glyphids, blood glucose, which are all part of metabolic syndrome. You've probably got tired of me telling you already that there's a little difference by age in the proportion of people with symptomatic OA, severity of pain, difficulty with activities or needing help. But this raises questions for us about the implications for aging with OA, including the implications of living for many years with pain and disability and multi-morbidity. And this perhaps is something that we need to think about when we're looking at subsequent waves of the CLSA. And secondly, and lastly, generally people with multi-joined OA would normally water soft, which has major implications both from the CLSA, but also for epidemiological studies in general. We really don't need to pay more attention to OA as a multi-joint condition, not looking separately as OA as an allost of the knee or osteoarthritis of the hand. It needs to join rheumatoid arthritis and some of the other kinds of arthritis has been recognized as something that affects many joints as you can imagine. I mean, the more joints affected, the more problems you're likely to have. In doing this, we were limited by the questions asked in the CLSA. And we had a number of things where we said, if only they had or wished they had or please could be. So first of all, a more practical question. I can understand why the CLSA asked about three joints. These are the perhaps the three most common joints or the three most talked about joints in OA. But it misses, as Anson has already pointed out, osteoarthritis in other joints. So I suggest we need to ask questions about osteoarthritis in other joints, including about osteoarthritis in the back, which is probably much neglected. I mean, in primary care, no, but in populations that is certainly yes. And another suggestion would be to do a harmonculus or a list asking about symptoms in all major joints. I mean, this has been used in the studies of living with chronic diseases as an adjunct to the SOC, or the SOC you see adjunct to the CCHS on arthritis. And it's perfectly feasible to do in this world. Anson, just the list. And this would actually enable us to look at patterns associated with multi-joint OA and actually multi-joint other arthritis. The CLSA only asked about difficulty with some basic activities to the sample and the tracking sample. The questions about ADL specific, and the questions of the tracking sample sort of general things like sort of standing stairs and things like this. The specific ADL questions, the actions of daily living questions like dressing and looking after yourself and the IADL questions like shopping and household activities were only asked about using the OZ and it was only focused on needing help. So we need to ask about difficulty with ADL and IADL. Particularly bearing in mind, the high proportion of difficulty with these basic activities, I would anticipate a high proportion of people with OA have difficulty with ADL and IADL. And particularly, I think when we actually asked about difficulty, we probably get the truer measures than we do when asking about needing help because I've already indicated needing help is partly cultural need determined and much more likely to ask for help with my housework than I am to ask for help dressing or going to an accident. So I suggest that the CLSA ask ADL, IADL difficulty questions, both as a tracking and comprehensive sample, so that we can study the evolution of dependence and frailty if you want to look at it that way and relate the statistical measures. And one possibility would be to modify the OZ questions to add a difficulty response option to be done relatively easily. And then finally, I think more generally, we need better claim measures in the CLSA because pain is relevant to many conditions and it's certainly relevant to aging and one of the major complaints in ADL. Discomfort is not the same as pain. And as I've already indicated, people may respond differently to general questions like, do you usually have pain? Is it very different from questions about do you have pain in a particular site or do you always have pain? Or do you have severe pain or do you have pain that comes and goes? So I think one of the issues, I would suggest one of the issues is to consider including a more complex pain question and including possibly the site of the pain, the quality of the pain, the temporality of the pain, temporality of the pain, whether it comes and goes, whether it's pain at rest or pain on movements and so on. So no, and I already said, I've already indicated we're going to debate more on metabolic syndrome. Our major preoccupation at the moment is our CIHR, separately analysis grants a bio-psychological social approach to understanding the impact of osteoarthritis on social participation. In doing this work or using the conceptual framework of the WHO international classification of functioning disability and health, the ICF. And our goal is to try and deconstruct the relationship between OA and social participation considering several domains. So the site of joints involved in OA, pain, activity and mobility restrictions and so on. So we expect a kind of a sequence here where osteoarthritis in the joints will lead to pain which will be associated with difficulty in general activities, which will lead to problems, for example, with mobility. And then we want to see the extent to which contextual, personal factors that's age in general and environmental factors such as social support modify these relationships. And the major issue we're grappling with is how to operationalize participation. I was going to, in the fair, we said we'd talk about our work on giving and receiving help and sort of kind of taste it for what we're doing. Unfortunately, when we put all these together, we finally just didn't have time until we got to talk about that on another occasion. So finally, in acknowledgement, we acknowledge funding from our CHR friends and also from the arthritis society who through a service contract gave us funding to help document the impact of our privacy population. And in particular, thanks for going to our Research Associates Stone Mill Standard Shop in Zip. Yep, for carrying out a lot of these analyses for us and continuing to work with us on these questions. So I turn now, I'm going to you for your questions. Thank you. Do we have to do anything now? No, just stand by for one second. Okay. Carol, it seems that you're muted. Sorry about that. Thank you very much for your excellent presentation. I really enjoyed it. We now open the session up for questions. A reminder that everybody's mute remains on, but you can enter your question into the chat box from the bottom right corner of the Webex window and we'll address your question that way. If you want to be identified, go ahead and there as well. Or your affiliate, I guess the question is... Yes, of course. Which section is gone there? Yeah, so we're confident that it's in underestimates by only focusing on the hand, hip and knee. The literature sort of suggests that the prevalence of back OA probably rivals that of knee OA. They're sort of jockeying for position between the most prevalent and it's always been between the knee and the back. So I mean, it's a prevalence sort of half more than what we see there because the back has been excluded. Foot OA and particularly amongst women is a big problem but it's been missed here. So from the perspective of trying to understand the impact of the disease at a population level and how it may relate to some of those outcomes that Lisa had presented, but also to understand the systemic components to OA, we really need to know how many joints are involved. And again, our hypothesis is that if the systemic etiology is one of the pathways, it is more likely that there will be multi-joint OA. But if we don't ask about OA in all the joints, then it's a bit tough to answer that question. So this is why one of our sort of suggestions for future CLSA surveys would be that it's asked of in every joint. The second question here is about the Western Ontario McMaster's University Osserecthoritis Index, WOMAC. Are you familiar with that? And it's not through the CLSA. No, it doesn't appear in the CLSA. So for those who don't know, so the WOMAC is a joint specific and OA specific measure of lower extremity pain and sorry, when I say lower extremity, I should say just hip and knee so it does not include anything else. So pain and physical function measure in OA. So no, it does not appear in the CLSA. Although that would have been quite nice, but no. Yeah, it's a physical function. One asks about pain and on things like getting out of the chair and climbing stairs. It was developed specifically for OA but actually could be relevant to other conditions. So it kind of gets at that. You're concerned about asking about the difficulties with activities, not just the needing help for. Correct. And in terms of the moment, it seems to be the industry standard, the WOMAC, in terms of studies of OA in the population, particularly around joint location. So that's kind of where you would be heading if you could guide more information for asking about difficulties with the activities that type of thing? Not necessarily the WOMAC, but a question that I asked about difficulty in sort of the important ADL and IADL and there are several of those. I mean, it's not just the WOMAC because I think I'm aware that the CLSA covers all conditions and it's also becoming more aware of the time of the importance of comorbidities. Correct. Because people get older, they acquire more and more comorbidities. So it's not like we're looking at joint replacement population where by large people may have other conditions but you're focusing just on the arthritis. I mean, one of the big challenges I think is to look at where osteoarthritis fits within the whole package of comorbidities that people have. And it's often one that tends to get neglected because some of the other conditions, for example, I mean, arguably things like diabetes, are much more salient to individuals. We talk about them a lot more, but when we actually look at the, what's the cause of the difficulty that people have in daily life? It's not the case, but the fact that you have heart disease, you have diabetes and OA could well contribute to making a lot of conditions worse. But we just don't understand this because we haven't heard of it. That's what the next few moments will be. I'm sorry, it seems like you're kind of fading in and out. So hopefully we'll keep you here for the rest of the QA session, but we are having a little bit of problems hearing you, I think. So I think maybe that leads kind of future directions particularly if you get the longitudinal nature of the data, which is kind of what happened, particularly for these younger adults, older adults, 45-year-olds who have young, long-term projects right at home. And what kind of... Sorry, you're broken up. We can't hear what's being said. I can hear you. Sorry about the difficulties. I wonder if there's an issue with the WebEx function. Carol, would you mind repeating the question one more time? Sure. Can the speakers hear me? We're very, very patchy trying to talk to our presenters. So one of the things that we can do as an alternative if it's helpful is that we can moderate the questions through the chat function. So for Lisa and Anthony, one of the things that we'll do is send you the questions via the chat function. And if you're comfortable typing the answers or typing a shortened version of the answers, we can do that. But let's try periodically to test the audio and see if we can get it back up and running. And to the attendees, I apologize for the difficulties that we're having. Hopefully, it'll get sorted out quickly. Can you hear us? Hello. There you go. That sounds very good now. Sounds like you're back, so. Can you hear us? Okay. Can you hear us? We can hear you. Causing mechanical damage, or do you think that there are other pathways? So I think part of the issue with metabolic syndrome can be, yes, the excess weight and the excess load-in. The other is that metabolic syndrome has been associated with low-grade systemic. I apologize, Anthony. It seems as though you've cut out again. Well, we'll thank our presenters. And maybe plan to take some questions. We're welcoming Dr. Christina Wolfen from McGill University.


If you're watching this video after the fact, make sure and check the notes in the description below for all the topics that we cover and when we cover them in the video. I'm not very organized, so this means you don't have... If you don't have two hours to spend hanging out with us, that's a great way to skip around and stuff. And I should say that there is now a GitHub repository full of all the old notes docs. I think it's github.com. Hey Johnny, hey Doctor. So github.com. So github.com. So github.com. So github.com. So github.com. So github.com. So github.com. So github.com. So github.com. So github.com. And then Patrick was awesome and went through and wrote a script so that all of the timecodes are linked. So if you ever wanna like figure out when I was talking about something, this is a great way to do that. And while I'm thinking of it, this would not be possible without David, who takes notes every week. So thank you, or almost every week. So thank you so much David for that. And thanks to Patrick for the things. Um, hi Keith, hi Keithie, hi Mark, hi Beata, thanks for hanging out, um, David pinged me like 10 minutes or 15 minutes ago and I was like still out chatting with the neighbors, so luckily I have a list of all the stuff I need to do before I get things going, um, we do have, uh, no cats in the cat cam, I left the door open and the cleaner vacuumed in here, which is awesome, um, but scared the cats out, so no cats in here and they're on their own, and I am actually in the middle of the stuff too, but we'll, uh, get there when we get there, it's only two o'clock, we'll wait a little while longer, I don't think I'm gonna need the overhead, I hadn't thought about that, hey Dishapu, thanks for joining, hey Bruce, I've got ice water, keep me cool, it's 85 in here right now, I think the high today was 86, I'm not sure what that is in Celsius, I'm sorry, but I think everything's going okay, you all can hear me, I sound okay, Haddon Jones says probably a silly question, but 7.0.0 of what, that's not a silly question, if you're new here, uh, Circuit Python, so Circuit Python, actually let me just do the housekeeping, hi 3D electronic, all right, so hello everyone, my name is Scott and I work for Adafruit on Circuit Python, Adafruit is an open source hardware and software company based out in New York City, they pay for me to work on Circuit Python and do these streams, they are also obviously this is their channel, they're based in New York City, I work remotely for them, so I'm in Seattle here, it's kind of warm, 30 Celsius says the chat, thank you Dishapu and Bruce, so Circuit Python is a version of Python designed to run on microcontrollers, which are little inexpensive computers, they end up on boards kind of like this, the chip here is the microcontroller, they're kind of like all in one computers that you run Python, which is awesome, so been working on that for a few years now, and yeah, so that's generally what we talk about, Adam had the question about 7.0 fixes is the title of the stream, hello Patrick, so that's what we're going to talk about, although I was working on something before so I may, we're going to veer into like PyOCD land probably, because that's where I left off before I went and got lunch, so if you want to chat with me and a lot of others, feel free to join our Discord server, that's the middle box here is our Discord channel, you can do that by going to the URL adafru.id slash Discord, this is a deep dive, it happens every week, normally Fridays at 2pm Pacific, but occasionally shifted to Thursdays, it typically goes for two hours or more, so get comfortable, go ahead and do something else, I try to read off questions so that you don't have to be watching the screen, questions are always welcome, and next week will also be on Friday because next Friday is Circuit Python Day, so I should chat about that a little bit, but I saw some questions in in the chat, so I'll get to those first, I don't have to say about the cat because he's not in here, he went downstairs, okay, so hello Dave, I think I said everyone, hello Dexter, hello Minnesota Mentat, hi DCD, hi Rakbit, that's an awesome animation, hi FomyGuy, hi Bruce S, hi Paul, hi Mr. Shortley, okay so FomyGuy had a question, Mama Rolf says hi OCD, what did I call it, hi OCD, I think we're talking about the same thing, so FomyGuy asks random meta question about the screen, how do you feed the Sony camera into your computer to get it into the screen, it plugs in with USB and has a driver or something, yeah so I have a magewell, so the camera outputs HDMI and then there's a magewell box that does USB 3 to my computer, and then just shows up as a regular kind of like camera for Linux, wow Bruce was busy, Mark says it's 95 there today in Canada, I haven't, I don't use the webcam driver, I did go for a walk as well, capture card or video capture device, yes, I have a magewell and if you want to know exactly what version it is, it was what Phil recommended I pick up, so I picked that up and he paid for it I think, so that's the dealio, I had a lot of trouble beforehand and when I updated my motherboard I was specifically looking for, specifically looking for a strong USB motherboard, Mr. certainly asks what was the deciding factor for the magewell versus the Elgato offerings, it was just whatever, I just went by what Phil recommended because he's been doing a lot of stuff, you know he's been streaming for a while so I just went with that, but Johnny says I use the webcam driver it works fine except for Microsoft Teams, Bruce says firesmoke.ca showing our current level, yeah it's a, I can spell it a little bit, it was, I noticed it like yesterday or the day before but it really, it's been not very noticeable, I have this, somebody has a call coming in, it's not me, I don't think, stay hydrated, thanks John, I've got you covered, I've learned to also go to the bathroom right before I stream because I drink so much water, ooh ribs and pulled pork barbecue, I'm barbecuing salmon tonight, that's gonna be good, okay, where do we want to start, let's start with Circuit Python Day, so I don't forget to talk about it, I don't know what we posted about Circuit Python Day, oh there's this cool video, did you all watch this video, yeah so I'll be doing, it's funny, oh you can't see my screen, so tentative activities, we have Jeff, Dan and Katnier doing a stream again, I think they're gonna show off some stuff, yeah we've had bad smoke days but it's not been too bad, I actually do have, I can hold this up, so I have this and maybe folks know, but I've got this thing I rigged for last year, this is the particle sensor, but it started giving me weirder readings, so it's saying like five right now, when it was really smoky here, it was up in the like hundred range or in the tens range, but I have that setting set up and it looks like it's actually kind of right now, for a while it was really bad, but yeah it doesn't look too bad and the windows are open, so it's not too bad, so yeah so somebody tacked on the special edition for the deep dive next week, if folks have ideas on how I could make the deep dive stream next week more special edition please let me know, otherwise it'll probably be the same thing, although it's not on here, but I think Keith the EE, correct me if I'm wrong, hello I am Joel, we are planning on doing a Reddit AMA next week I think and Keith can confirm and if there's a link Keith can put that in the discord as well, but I think that's the plan, yeah so we'll do what we're gonna do is we're gonna do a circuit python AMA on the python discord, the python subreddit so that should be fun and maybe there's some topics that'll come out of that that would be interesting, I'm Joel too, no I'm Scott, but that's clever, okay so keep an eye out on the python subreddit for the for the AMA announcement, but we are, Keith the EE was asking me about it and I was like you know it would be cool to do that for a circuit python day next week and he was like uh okay yeah sorry for all the folks that are dealing with smoke it's no fun, I can relate, there'll be a pinned post on the main page of the python subreddit, oh foamy guy we can put this in this article, so foamy guy says it's less official capacity but I'm planning to stream at 11 a.m. Eastern on circuit python day as well, so yeah there'll be lots of streams, we'll do the AMA, so that'll be cool and if you have ideas that I could do to make my deep dive special next week please let me know, the best way to let me know is just like join circuit python dev on um circuit python dev on discord and and just at me in there, so yeah okay uh there was one other thing, oh so deep dive notes, what was else on the list uh the red at AMA, okay so I cover that, so ask patrick w who watches these streams occasionally and has been super helpful was asking me whether I have a collection or a place where all the deep dive notes are um and so what I was like oh well we could just make a github repo for it and the nice thing about github repos is that what you can do is wear a purple hat, I don't know if I have a purple hat um I don't know I could wear something I guess uh yeah so there's github.com slash adafruit slash deep dive notes you can clone it and then you can um what you can do is you can like just grab it like search their repo I guess you could search on github as well because it's not a fork so if you ever want to find something uh on the previous deep dives from when we had uh notes thanks to david um check this repo out and patrick did a cool thing and I think I showed it earlier but I'll show it again if you click into particular day um the time codes are actually links so the they'll link to like the specific spot in the specific video which is pretty awesome so thanks to patrick and thanks to david uh for taking notes and putting that together all right uh if folks have more questions go ahead and ask them otherwise I think I'm gonna just jump into all right I could look at what I've fixed maybe I'll do that first before I get into debugging but I have been doing some debugging that I haven't figured out yet so I want to get back to that but let's just take a look at the PRs that came through this week um so oh yeah so thanks to david uh suggesting using all four leds on the mag tag as a status thing um dashipu asks how hard do you think it would be to get circuit by then to run on the sam l21 as opposed to the d21 talk to the electronic cats folks I think they've tried it um they would have a better idea because I I think they were working on it so I would I would google around I think somebody has been trying to do that and I think it's electronic cats folks that have um the other person I think joey castillo might have been looking at it as well for his watch so I think people have been looking at it um how hard I don't know they would have a better idea um okay so we'll take a look at that and the pulse out stuff I did oh and you know what I have a review to do to dan for dan so I should do that as well multiple status neopixels um yeah I think that's it so uh I'll do the I'll do the review for dan too um so a couple of fake see fake sleep bugs on nrf and esp so um fake sleep is when you write circuit python code that is doing a deep sleep so when you do a deep sleep it it exits your exits your code um and then shuts ever as much as it possibly can down before and then wakes up based on the conditions you set before you went into deep sleep um but the way that it works is that if you're on usb like you're testing your code um what will happen is that it won't actually deep sleep because deep proper deep sleep will lose usb connection so but if you're prototyping it we have a mode that is fake deep sleep which is your code still exits but the circuit python stays running the whole time um and we had a couple bugs in uh that code that had leaked in so um those are on the nrf and the esp so um one thing I did was we added the ability for uh thanks to christian christian added the ability to save the exception string from a run uh so that you can access it the next time you run um and there was a problem with that with doing the deep sleep trace back because the way deep sleep works is when you say exit and deep deep sleep it actually raises the deep sleep deep sleep exception um and so to fix a bug with that what I did is it just said like oh if the so this is in pyexec click it a little bit further so where it's actually running your code is right here so this is like okay so this is somewhere in it's like in pyexec parse compile loop or something um so it sets up and it does a function call to run your code and then as it exits it figures out like oh was there did it exit because of an exception and then if it's a deep sleep exception we'll set the return value to indicate that it's deep sleep but then also if if there is a result what it will do is it will save it in this exception thing and that's what gets printed by the the exception printer thing and so what I did is like it was crashing when trying to use the deep sleep exception so instead what I did is I just said like oh if it's deep sleep don't bother setting the exception so that was one fix another fix on the s2 was that um if you did one real deep sleep and then did and then usb connects and you're doing uh fake deep sleeps the fake deep sleeps would not work um on the esp because this the esp idf when you do this get wake up cause uh was returning the value from the first deep sleep so um there's a flag here that just says like oh is this the first time we woke up and if not um don't don't listen to the idf um this is the real well the the bug that got me into it the the bug that got me into it was that um when you're doing a time sleep that's one way to wake up from a deep sleep or or a light sleep is based on time and uh what was happening is that when we were fake deep sleeping a time wait on esp you weren't able to control c out of it like it says you can um and so what I did here is the esp is a little weird and that has two tasks running um and so the usb stuff still works because the usb is running in a different task than circuit python um but what we were doing is we were only triggering the circuit python task when the interrupt character was set but that's only set when user code is running um so what I did is I moved it kind of outside this check so that whenever control c is uh is seen by tiny usb will trigger the circuit python task and ask patrick found that a sam l 21 um and then this is just a minor thing for i'm i'm trying to get it going on gc gcc 11 and this is a minor um thing for checking um nrf time sleep wasn't working because it wasn't setting these this internal state when the alarms are actually set it was setting it too early and then i deleted a bunch of debug this it was setting resetting it back to me um so i fixed that as well that was one thing um this is the thing i was working on a while um pwm out we're switching the api to take in a pin uh frequency in a duty cycle rather the old api takes in a pwm out and then controls that which is great but it assumes how it assumes the method for implementation and the esp 32 s2 doesn't actually need the resources that a pwm out uses in order to do it so we started moving to this model and you'll see it in i think it's in six but it's in at least in earlier betas where like you can kind of do both ways but you could only do you could only do that newer way on esp so what i went back and made all of the implementations work like the new api which takes the pin um and then i also found some pwm out problems um so i fixed those as well and thanks to dm com for doing some some thorough testing on my stuff um i added support for multiple status new pixels which i think i did on the stream last week um so that's good too and uh did that for the playgrounds and i did that for the the mag tag at david's request as well uh any questions folks want me to answer hi on car i say it right um maybe i should take a look at this so this is uh dan's been like working for weeks to try to make the audio playback better um so let me see here he's got six files changed i could probably do that on here cat and he's gonna try it crunchy playback and program hanging he's still working on it oh and there's 45 checks failing maybe i'll wait i don't need to do that on the street ate a fruit can build home automation full product in future i'm not sure exactly what you're asking home automation is a lot of different things to different people all right i think i'm gonna ignore this since there's more work to be done i think i'll do that next week um so i thought i thought um talking about pi ocd would be a very cool thing for us to do so folks may know open ocd which is a way to uh david says any progress on your gameboy related personal project i now have a rp2040 game link adapter and i follow someone making an rp2040 powered cartridge i have not made any progress but i will love to see those two things if you have links for them please share them with me i'd love i'd love somebody else to make the hardware honestly um what's this ocd thing yeah so um open on chip debugger so ocd is on chip debugger and it's the software oh great infinite redirect brilliant uh so it's the software that um translates between your debugger nothing's too much of a tangent krs13 says what gameboy project if it's not too much of a tangent so i was working the gameboy project i was working on was a samd51 powered um gameboy cartridge that you could program in circuit python so what circuit python did is it queued up assembly instructions to the gameboy to do different things like loading tile like sprites into memory and moving them around and all of that um i have a talk that i did at pterodome gameboy i think it was a super charger hardware old man who was circuit python i think that's it yeah all right uh thank you everybody for coming uh i always talk louder than i intended to post watching online now and thank you uh first an introduction uh i'm scott schachroff i go by clock and power i showed the website earlier okay i i don't need to watch my own presentation but i will link to it in the chats uh but yeah the basic idea is that um tangent of the past yeah 2019 um deep tangents is my nickname for this stream yeah people have come to expect that um all right let's not look at the terrible recommendations okay so uh yeah so the idea was making a pcb i am not the owner of adafruit concar asks um but yeah really trying to leave all your like gaming logic in the circuit python cart but then using the gameboy for button inputs and and display and stuff like that so yeah anthony says i think they're asking if the home automation support will be complex enough to have its own api framework for circuit python i don't think so i don't think that we'll have our own framework if you look we already have like an mqtt library um and that's pretty good and then a lot of our focus on the on the ios side right now is with whippersnapper which is very cool and i suggest people look at that but it's like a no code like just on the website you say what sensors are connected and then that automatically will give you the values back from it um adam jones says and yay since nothing is since nothing is too much of a tangent i'm getting back into microcontrollers to do a hobby project and looking for help finding any projects or libraries for signal triangulation um uh i don't know uh but hopefully some folks in the chat here will have ideas for for signal triangulation um i would say i would ask what like types of signals you're talking about like what radio rate what rf frequency ranges and things um krs 13 i work on a python based gameboy emulator if you want to talk more about that sounds like a cool project probably too slow for circumcised on but yeah that's awesome on kiwi str is a suggestion um yeah it was interesting it was really interesting from their perspective of the the gameboy cart stuff because like it was us answering the cpu rather than us being the cpu like like emulators are reading the roms right and then doing stuff whereas like we're kind of doing the reverse when we're the cart itself but i would love to see if we could find if somebody found the hardware like i did most of the software i really got hung up i think the rp 2040 is a better chip for it but i think the way that i was doing it with the cmd 51 i was occasionally um i was occasionally having to um i think the dma on the samd 51 was not always timely enough for the gameboy so i think what was happening is that i was end up ended up um returning the wrong data and then it goes off into the weeds and crashes and stuff so so i got it a long ways through it um i got it so folks are asking racpet asks as a gameboy cart you have to embed the nintendo logo for copy protection right yes so you have so the the roms on the gameboy will request the memory for the gameboy logo for the nintendo logo twice um once as a copy protection thing and once as a like now i'm going to display it sort of thing um and because we're not actually fixed memory what i have have the circuit so i have code for circuit python to to do all this like i got pretty far um and i got it working on the gameboy color as well um so what i would do is i would return the nintendo bytes logo bytes back the first time and then the second time i wouldn't the second time i would return something else i think i return it like i got an adafruit logo instead um so there's both um ble trilateral trilateralation is on my short list of projects for my home system so you have a recommendation um or ham radio fox hunt stuff um nice gameboy type thing with a big sharp display that's what the um um what these have the they just opened pre-order to these two i think right um tithe on twitch this can't find a whipper snapper software you talk of any chance of a link yeah let me find it i think if you go to blog to adafruit.com and then i think it's spelled wrong which we like to do i think there's probably a blog post about it my first step for wednesday yeah so here's i think the best link for it it's part of i o um somebody uh on gameboy cartridge using rp2040 all right let's pull it up oh not there oh that's awesome um mine had midi which is pretty neat but i would totally just go with interesting i wonder how it is connected i shall follow this person because that is curious thank you for the link dude it looks a lot less crowded than my version but my version has midi stuff which is pretty needed all right pretty cool um talking about triangulation and like indoor location stuff um let's just find this see i think more put more folks asked questions once we establish tangents are okay um all right let's make it a little smaller bealy beacon so somebody was asking about bealy beacon yeah so in this thomas here just linked to two studies about um using bealy beacons for indoor navigation so i would recommend this as well dexter says is there a limit on the sample rate of a wave file for rp2040 um we have dan's working on this actively um and check out that pr that he had um but basically if it sounds bad try a lower sample rate um dan's doing a lot of debugging on the audio playback of waves on their rp2040 right now so yeah sit tight that the audio playback should be getting better oh cool eventually it would be cool to have narrated nature walk with the proximity base triggers but also um at nighttime have lights illuminate as you walk near them have a text i'm such a terrible live streamer um we have visitors coming later so tan needs tangents that's a very core scenario for bealy beacons at museums and stuff need to be see it done and certified on that would be amazing um laura and blue fruit solutions might be better if you use for your use case yeah if you're talking about location stuff doctor says some streamers just do things and totally ignore the audience so you're not that bad and the mark says the esp32 s2 has something coming last i saw about wi-fi location type says thanks god got foxed by the british love of silent ages well that and like usually the way that eight of your brand's things is like even if the if you even if you think you know how it's spelled it's not always the case so yeah happy to link you that's i'm happy to do that on my stream happy to help people all right um should we pop the stack and get back to ocd so there's open ocd which i've kind of like had mixed feelings about it's so it's the software that bridges talking kind of to a microcontroller and talking to like a standard debugger like gdb or l o db um i don't use that jlink has their equivalent which is the like jlink um gdb server which does that too um so there's that oh the bot might have not liked the long jump comment sorry about the bot if if you think it was mistaken then that's fine uh or we can fix it later um so there's also this project called pyocd which is what i want to actually where i'm trying to go with this pyocd is pretty cool it's all python and it's python that talks to uh hey asden nice to tune in once again welcome we're just hanging out if you have questions or i'd like to i'd love to hear how things are going to um ah okay we did it hey unexpected makers here too this is why i stream for two hours so that people can drop in 30 minutes into it that's the only reason it's not all the tangents it's not the fact that i haven't gotten to the thing that i would make sure and do or that i wanted to do oh does it and everybody's deleting stuff funny that you talk about open ocd and pyocd right when i tune in yeah i was wishing i had a black magic probe i'm not sure i do um hey james getting off work ah yeah good tangent following engaged yeah so pyocd is really cool um it requires them so yeah i mean i like i also got a jlink and like the jlinks worked really well but here's the but so this has been the problem that i've had is that right now arm gdb hates me david says i got my black magic recently do i need to borrow i might actually have one so what's the unexpected maker asks what's the difference between pyocd and open ocd so i think open i think they they have the same role but the way that so there is some um differences or some configuration that needs to happen on a kind of like per chip basis and the open ocd stuff is in like tickle or something so like i obviously am biased um yeah it's the site doesn't work still so if we look in open ocd like i've always said yeah there's like tcl stuff and it's like all this like it supports a lot of stuff but it's like in a thing that i don't really understand um so it does a lot of things it has a lot of support um but i have a python bias so that's part of my problem um rack that says pyocd does use the jlink software whereas open ocd talks to the jlink directly as far as i know for my jlink education addition for instance it will pop up the daily warning window oh interesting but i have been enjoying using pyocd a lot yeah so i have a jlink base um so what i've been doing so i have this problem i i'm trying to debug some crashes on the feather nrf 52840 board in the like bealy workflow stuff i got really hamstrung by it because what is happening is that the crashes happen when i do an lto link time optimized version so link time optimization is uh where it takes all the code for the whole thing all of circuit python and it optimizes it all together there's not something you can traditionally do for like big applications but because like microcontrollers are quite small um like i we just do that and that means that it's also like a little bit more optimized because the the linker and the and the compiler can optimize like the whole thing all all together um but for some reason when i that's called link time optimization and i call it lto for sure the problem is that my gdb has started hanging and just taking more and more memory when i try to load those binaries up um and i'm not sure why so i basically can't debug lto compiled things right now in gdb um i was trying my darndest to use lldb which is the llvm version of the debugger um it loads okay but it was at one point it wasn't walking the stack kind of i was getting a hard fault handler and it only walked the stack up to the top of the hard fault hard fault handler it wouldn't go past that so i started looking into this pi ocd thing because i was like heck i'll just write my own you know me i'm like what if i maybe i'll just write my own debugger um nice evan psd is now in the discord as well so you found the great place to ask about uh the positioning indoor positioning stuff um i finally got open ocd working on my mac to flash sandy via my atma ice but i prefer to use python if i could yeah so i've gotten flashing working it's using the jlink so that i have the jlink connected to the feather um it is not very fast but i kind of assume that's a a jlink thing not a pi ocd thing um so yeah so i've been playing around with pi ocd so i've got the script that i'm working on and basically what happens with circuit python in these cases is that it's just crashing when it starts up so um what i have is just a script that is just like connect to the thing and like print some stuff out so um here's some i forget what i started with some pi ocd thing and then you can actually have it um load so if i want to load the file i can uncomment this um elf symbol provider is the like given an address we can figure out where it is um i feel like saying roll my own ocd is almost like saying roll my own crypto well so the thing that seems pretty cool about this is that like i don't this is kind of my debugger um to some degree it's not interactive but it is like giving me enough information so what i've got it doing right now is like i'm loading the symbols i'm printing out the sections i'm loading the file but not really because i have to comment it out and then i just halt the target and then i start reading stuff so i read the program counter the stack pointer the two different stack pointers so dwarf dwarf info is all of the debug info so i get the dwarf stuff i get some ranges main compilation unit and now i can do this like what line for this or then i build this table for like given an address what is the lines more debug stuff um but i have this thing here i know i invited that's not that's fine this walks the stack so for every value on the stack it tries to like figure out where where the value is coming from and that gives me like a course back trace of everything so um i'll show you what that looks like so here's an example that i just ran um here you can see that i i was gonna have it so one way if we have a safe mode crash in circuit python all of those go through this reset into safe mode so yeah dcd asks is this python code talking through the j-link correct so this python code controls my nrf uh my nrf device um through python bruce says i'm not sure what fast means i use the mini edu jlink to flash nrf feather boards and it seems okay yeah so what we have here is we can see the program counter this is the symbol info for the program counter and then this is actually the line info so what we can see is that like when this halted um it ended up in this like startup phase thing so what i've been trying to do is figure out why it's crashing um um so it's it's crashing really it it something is being corrupted so let me just comment this out and we'll rebuild the load let's make it i'll double click it hey mark i don't think i said how do you yeah okay copy that over as then if you're still watching you might be able to help um i was trying to use so there's a gdb server in pyocd and i was trying to use it from lldb but lldb i was trying to run uh like run the run command and it doesn't work with pyocd because it does some weird signaling stuff this is the problem that i got burnt out a while back on okay so i just copied it over yeah lldb is using the protocol differently yeah yeah this protocol that seems like a standard but that's not a standard so i'm just gonna hit uh restart on there it blanked red for the um for the bootloader but then didn't do anything gdb lld but db side is not specified only the side of the server yeah even when i looked up like the k command for kill it was like this is different like it's not well defined david asks i remember you mentioning somewhere about a bug requiring it a hit-enabled device for macropod that got fixed i think i'm hitting it what do you do what do i need to get the fix latest cp lives other um i'd not i would just try the absolute latest from absolute latest version of circuit python first try that first um otherwise i would hop on the discord and post the the error that you're having anthony asks who thinks that optimization is not worth it optimizing early is not a is not worth it for sure ah marx says i was playing with open pyocd earlier today script flashing scripting flashing from our universal testing that's pretty awesome asden says in any case if you implement a client you have trouble making sure it will work with other implementations that is why lldb does not always work same thing with other debuggers yeah and that's kind of why i was like maybe i'll just see what i can do with pyocd myself um one thing i asked added in the script was like if it hits a hard fault handler it like automatically will print out like the hard fault registers which i think is pretty neat so i think there is a place for these like i'm just going to start circuit python up run it and then see where it stops um and these back traces are like not spectacular but they're also not terrible so like what we're seeing here is now we're in port in it um and we can see the line is port c line 156 and that's coming from the reset handler so there's some weird memory corruption happening and i'm not sure why um but if we pull up port we can see that right in the top of port and that i have this like if the preschooler is not equal to this value then just spin um oh yeah there's the if you heard the honking like the uh the intersection here has had like a number of times where people have gotten in accidents it used to be it's just an intersection it used to have no stop signs at all that was always a problem and then they added two stop signs so one direction you don't stop in the other direction you're supposed to stop it's just like they need to put a round about it it's like it's a residential neighborhood people don't need to go fast um so so what this is doing is that there's this rtc rtc config that initializes to this value and then at the very start of port in it which actually is the start of main um what we're doing is we're saying if it's not equal to the value that it should be then we're then we're infinite looping oh so i tried that uh as in says train to add support for the black magic probe to radari 2 was a nightmare as they used the protocol wrong i actually tried that a little bit to see if i could get that going and it was like like no good either um mark says i couldn't get open ocd to flash an stm 32 l0 that uh was in low power it wouldn't wake up before flashing but pyocd did it really easily it's the whole pie versus tickle thing yeah yeah so i think pyocd is really neat and uh it it seems like a really really handy tool if anybody wants to figure out how to unwind the stack that would be amazing but i was starting to look at it it was like it is complicated figuring out like where all the variables are and stuff but yeah i would love to see i want like a pi db like not not pdb which is like the python debugger for debugging python code but i would love like the pyocd equivalent of gdb i think that would be awesome because python is just like so much more extensible and easier to easier to understand okay um yeah so i have this check that's saying like oh this value that should be initialized at startup is not what it is then like wait and so i was trying to figure out maybe what i want to do is i actually want to do an option so so port here is checking rtc config and then what i thought so the place that so the way that this works the when you reset the bootloader goes and then it changes um changes the interrupt vector offset and then it calls the reset handler so the bootloader calls this reset handler directly and it does two sorts of memory initial memory initialization tasks the first here is that it copies data from flash to ram because those are all the like initialization values that are going to get used so if we look back at this port c we can see that this rtc config is not const which means you can actually change these values so um so that has to get initialized somehow and the way that it's initializes with the startup nrf 52 840 and this it's just a wire loop that copies data from flash into the spot in memory and then the second thing is bss is i don't know what it stands for but it gets zeroed out so this does the whole range of zeros so this is anything that is like that first dropped but all of the values are zero they just get you just do like a whole pass zeroing everything out and then we call this system in it which is i looked at it looks like it's just setting it some hardware stuff um but it if i add this after so this loop is a lot like this first loop except what it's doing is it's saying um it's just checking it's saying if the destination is not equal to the source value then we infinite loop and we'll see it on our backtrace otherwise uh just increment the both and uh then go around the loop again um so very very similar so oh so if i save that as then what have you been up to what's the latest and greatest from one bit squared as i compile and reload it blocks started by symbol is bss very old school thing from ibm times according to wikipedia open ocd i think can do esp stuff whereas like pyocd doesn't do esp chips yet i don't think which i guess i should have said earlier when unexpected maker was talking about it jean dunn says i'm fascinated by how many types of debugging and analysis can be done definitely a bit above my depth for now but i know it's coming he it's true this i mean this is the first time i've done pyocd i used i've done it um i've done similar stuff before with uh gdb but okay it's just the weirdest thing it just like the very first time it happened to me i just like my linux computer screeched to a halt as it the whole ram got filled up and i've been waiting to see like a new version of gdb come in and i haven't seen it um and it's only lto builds that do it too so i it's the weirdest thing as in is fighting the chip shortages for glasco oh yeah the chip shortage stuff is rough analog discovery too will get me working with all sorts of low data flows like that it's true yes it will okay so so now we're we're stuck in the startup and line 69 so the thing i was gonna add was actually i was gonna add a um register register print um oh not using open ocd with esp 30 so i think register prints can be pretty simple i was gonna do four i and i think there's 12 that we can read we can print i've been doing f strings because f strings with all the rage string i guess that's not what i want just one and then value is equal to target read corner register print value but we're gonna do it as a hex so i'm curious to see what addresses are in there and as in says we made an fpga mechanical keyboard atreus keep it keyboard conversion with fpga instead of an mcu now working on a demo scene game console hardware with icebreaker bits inside working on a new revision of the black magic probe to to compensate for chip shortages and add some new features nice good to stay busy i versus reg i suppose you beat the you beat the scripts Linux to boot on the icebreaker that's ridiculous i did like the pie five stuff seems uh pretty neat as well really uh remove this so i think ram starts i don't actually know what ram 20 second boot time that's impressive let's take a look at the map because i think this uh 2001 000 is the end of ram and then this 8064 must be we are so the map file there's a great talk from elicia oh and i'm wrong this um 2001 is the start it's the start of the data section which is where we should start by copying this 2001 0 55 cc is not there huh because i was kind of hoping to figure out where in that loop it was when it's validating that's like like so something's weird right like it feels like something in system in it is clobbering my memory so i don't know what happens if i do debugging stuff like this is like very satisfying when you figure it out but and then while you're doing it it's not not very fun but like there was another failure mode i saw this is where the timer stuff gets corrupted but i found a spot where the some data about the u arts is corrupted as well and so like whenever you see memory corruption like that like it's bad news and you should really try to find it this is why i need to do rust at some point because rust has more semantics that the language gives you and which should make it easier for the compiler to detect them so you don't have to do debugging like this um okay i'm gonna hit reset and then we'll do the script again the other thing we could do is a watchpoint actually that might be the next thing i do or make a random comment or print and hope the memory error goes away become a fellow rustation it's only a matter of time i i the people that have come being like i want rust in circuit python i'm like you get the build system going and i'm there right like i would love to start doing rust in circuit python because i have spent so much time dealing with memory corruption issues that it's the worst it's only a matter of time oh look at this so this this value here is not at the start it's later on um but i guess we're also now we're in port and at 156 so even though we commented out we're still there like there's gotta be something super obvious the program color is important it what is it obstum i like i do miss having pattern not found like it could be some battery reordering here we go no see like here's main and it's port and it they're like it branches right to port and it i just got an email from instagram saying we're we're sorry you're having trouble logging in instagram i did not just try to get into instagram who's trying to log into my instagram is there a button say it wasn't me well there isn't a button this isn't one of the okay well it could be official too Todd says i get those all the time great that's what we want um a space at the end of a max length string so much love for rust i'm really excited to see where it'll be in a couple years yeah so it seems like it's still not correct i thought i had tested so where's the reset handler i expected that to be in here do i need to do capital d i just like put this extra like space into it i just have a i have a while loop that is checking that the initialized value is what it should be and it's not even though there's like no code that should happen before it oops the vectors isn't it responding to me there we go it's reset underscore handler go figure okay like it just branches to main so like what is what is messing my memory up you know i was thinking it could be um some weird dma or something let's see if we get set a watch point we have a number um let's just do the script again this is what i like about this script is like i'm not restarting the device every time i'm just like changing the way that i'm inspecting it i really should remove the cfi stuff i was trying to reset unwind the stack but i'm not using it at all i couldn't figure out how to get the right addresses all right so we're in port now in reset handler right interesting so we catch it in port it seems like a timing thing like it's something that is so weird let's just watch this address so i think what we do is we say so somewhere comment it out here i have set breakpoint goodnight dave i wonder if there's a watch point of that address and then what we want to do is we want to reset and halt i think is what it is and then resume and then since we're gonna wait let's wait like one second is it set set watch point one thing that pyocd does not do that they should is uh read the docs for all this sort of stuff yeah that's right set watch point has a size and a type what do we think that is i don't know what else it needs right and oh it just calls up to the dw if type not in watch two what are my options oh i see um i want writes yeah open source is the best it could be the soft device i mean size is gonna be four sizes in bites maybe although their comments aren't there great watch size to mask well that should work four is a power of two all right let's try it and i'm gonna cannot save it it's not gonna know what target is either offset line 70 see you offset let's just wait a little longer which memory are you trying to ensure is not being corrupted stack data vss or code uh data i'm on the chair yeah do not model my posture my posture is bad it's still not happy and the stack pointer hasn't moved what is that like there's this i don't know if reset and haul is changing my program counter or not oh there we go now the program counter is in the reset handler this cfi loading is wow 59 halt and catch fire it's still pretty slow that's the slow part it could be it must be uh these oh see we have a watch point so what we have to do is we have to this is the first time it's set which is fine so what we're gonna do is we're gonna do a loop of this four two we want to do this twice we don't care about the first time we care about the second time and this is why pyocd is really neat but look at that like the second time because core zero is not halted well where the heck is it so it's like something besides the cpu is clobbering it which is super bizarre is it possible my ram is broken i had it at one point read it back like i'm on usb i wonder if i disable usb whether it works or not okay so now we're in the port stuff so let's just print out this memory address so we can print see we can read memory it i don't know if we can read memory well it's not halted do you have a second nrf board i do in fact i have one right here to check against batteran how do you get the not equal sign i'm used to using exclamation equals it's the font so i type exclamation equals and the font changes it yep i think you folks are right we should do a i have another feather right here i'll just test it um it's zero which doesn't seem right bruce says fear of code yeah i think that's what i'm using too yeah as in says ligature fonts to the for the win yeah so ligatures are different symbols that happen when two characters are next to each other um i get also i get nice arrows as well well apparently i don't have it in my terminal oh they did huh well it didn't do the arrow there um that's so weird i don't actually know what the value should be one glyph for multiple characters these three good-looking prints it's all zeros no we could do we could print out this whole range let's do that for i in so if we look at our memory map again we're curious to go from this is e data yeah maybe we're so that's the end and we're gonna want to go on four bite boundaries i can actually tell range to go by four right see when i can read the flash flash start is from the load address i'm looking at the data section and the load addresses this okay let's see what that does it'll probably crash programming fonts with ligatures cast katia calling it target maybe isn't good that's very true assuming that's what the problem is offset offset's not defined either do so this is the time out ah okay so you know the other thing i could do is i could say whether they're the same or not it looks like they are this could totally be not even a problem or something weird it doesn't it doesn't make any sense to me yeah the script thinks it's all okay why is that but now we're in portline 156 maybe this is not being initialized correctly portline 156 is if rtc prescalar does not equal frequency to prescalar rtc config is here so it should be within our range what am i doing wrong any chance you can give a short overview of the issue i missed bits and pieces what should happen so what i was finding is i was finding that um so this is checking the rt rtc prescalar value and if i remove this loop it hits an assert later on in the code that fails the assert is equivalent the assert is tickier than this but like i don't see any reason why like it should be the same 006 i was get yeah i was i was hitting asserts that's that was my problem is that i'm hitting asserts i don't know i could look at this next week and be like what was i thinking this is not a problem but it it seems proper and it seems weird what are the types for that struct maybe a type misalignment possible i am compiling it with lto let's find this rtc config i'm in debug mode that's why i'm hitting the asserts and i'm doing lto nrf x how no not how they include here it is it's a unit 16 followed by so why is it it's six so two bytes one byte one byte one byte so it looks like it's aligned this is where field spugger would be nicer i wouldn't have to do it ad hoc but it should be at the start of that dealer so three thirty i want to print out i mean it seems weird right something to construct this static and not moving since it isn't like that i mean that seems so weird it's so weird to me that i mean i do have edits to this see so if i save it and what are the variables immediately able for an after pyocd doesn't say anything's getting crashed though which is very weird oh you know what we were going to try a different one i'm going to switch the feather out right now data lines back on if this works i'm gonna like i hope it doesn't i spent way too much time on this this is how it goes though it's copying copying copying oh it didn't start up i get no blinky oh we got an e there that's a different value though oh look at that it's all different that seems weird we're in startup dot c line 69 like it wasn't able to copy any of it over like it does look like it's not right at all let me um hit the that was unexpected yeah i did not expect that it's still e and it's still wrong it's like completely wrong did i break like this is right right yeah dcd i had a code review for dan that i was thinking about doing but i wonder if it's reordering it i mean it's being too smart i mean that it could be true i decided not to do the review for dan because it wasn't working perfectly is this what you were seeing before no it's not like you would think it would be smart about ordering so we've got 20 more minutes i'll probably just keep banging my head on this if folks have questions and want to distract me and take me on the tangent uh now's a great time so i don't have to keep banging my head against the wall yeah it's easy to say the compiler is wrong but in practice it's usually not all right so there's a completely different value in there now was e it still says it's completely wrong oh you know why i bet the bounds i hard coded the bounds of the uh that's what it is i hard coded the bounds of what i'm comparing so if we look at these two at this number it's probably completely different what is the load address now a ffd8 that's the problem with the hard coding and how long is it i bet i could look it up from the debug stuff i have but i'm not sure how about having a gdb stub in the circuit pipeline so you can connect with gdb directly this is something you can do in situations where you want to some debugging an easy way and provide it without having a jtag swg adapter um i mean my problem isn't that the stub problem i don't really know what that entails and given that the pyocd gdb stub doesn't work that well but like my problem is gdb right now my problem is that if i load an elf that is an lto into gdb it just takes all my memory up and if i use l ldb it loads okay but then the backtrace is not as good as like it doesn't when i saw it it wasn't going past the uh hard fault antlers in this case it might work maybe i should try that all right so interesting did i have an off by one error that there's a single value that's wrong um ask patrick w asks so it's watching you use the salient in some older episodes you mentioned your own analyzer project have you had time to think about that at all um mark gambler i think did a lot and as estin might know that actually estin might know the sigrock people last i heard mark had gotten the rp20 40 connecting to a sigrock and had a pull request open but hadn't heard back to the from the sigrock people um so mark got really far with it but then hit the wall of like trying to get it into sigrock and mark's in the chat so mark will give us an update it takes time to bring things in i mean i understand that but last i heard he hadn't even gotten a reply like i spend a lot of my time doing email mark got it going and k match did the work k match did the work to get it into sigrock so there's one value that's different okay sorry i was wrong mark did some good stuff to csv but k match really did the work to get it into sigrock get all the control stuff going so the first memory address is different but by the time we're stopping we're in um port i don't trust this power warning handler start up line 73 we've definitely made uh right so we're in main and now we're in port line 73 we're not in the assert we're in ticking it ticking it is in port 120 oh yeah so i have a similar check here and if i don't comment that or comment that good night dishipu i might have missed you doesn't make any sense to me it's no sense i copied it but we're right is this the mage ball you have uh i think so yeah usb capture hdmi plus sounds right this is okay i'm not worried about that changing because we are further in the call stack um i can bug me after the stream and i'll look at my email to confirm the mage ball yeah see so here now we're in um assert so we're in this nrfx rtc init which had an assert problem which is only gonna happen in debug which causes us to print it out and then we get into printing stuff and we're in printing stuff and we're in printing stuff and we're in printing stuff and we have problems printing stuff and we're trying to allocate an exception i've got to stop writing for us we have guests um the $20 hdmi dongle is really close in quality if you're going to text you have to share your screen with the whole class you missed it earlier i was texting earlier too um that's not how it works yeah so this is the problem this is why i was like adding these things previously so he's like at some point i hit the cert statement and i have a problem so i was like using these wild truths to like stop earlier to figure out where is it she being changed and why doesn't it why isn't it right um let me let's just take a look at what this is see it's just a bit of math so it's rtc input frequency divided by that minus one which should be okay guess as in non household humans in the same physical space strange concept it is i think they're the first guess we've had is this all before interrupts are enabled like no other code can run in spite of the wild true now i think interrupts are on i think interrupts are on but by the time we halt but by the time we halt it should have run and we should see it right like we should be able to confirm that it's happening because we're printing out the memory right like here are we not going far enough we're only going to oh you know what i bet that's it let's see i'm dividing by four here and then i'm going by four again that's wrong so i'm not going to print everything off 2231 puppy says i've never seen fish shell before should i try it doesn't work on mac it works on mac and i recommend it um so why was the first word reporting the difference i mean it's it's far enough long that maybe something's changing it like i don't know what variable is there um but everything here still is the same and we're still in this ad spot what is the address of the rtc config is 334 it's zero it's being saved as zero because it's little and in i think so zero one dfc the first eight bytes or something is not user memory but is something internal that the nbr soft device uses really i mean that i mean there's system system core clock is what's there that first word is system core clock i think we do set aside the ram ourselves for the soft device so i don't think that's the problem and out of ideas like it's possible it's zero which seems like it would be okay the assert that we're actually failing is i looked it up my brain is toast rtc init config p config preschooler set did i like accidentally type something did i delete a no rtc config with an ampersand this is where i wish i could print rtc frequency to prescalar 32k wait so we got past this is this all just prescalar set i don't know i can wrap up here oh it's in here see assert value has to be less than prescalar mask which zero zero should be i think mac comes with zz shell now yeah set up a software ur yeah i don't know i'm with mark that says i give up all right yeah i'm gonna call it um sorry sometimes you just spend a lot of time and you don't end up with anything that's the way that programming goes um thank you all for joining me for this deep dive it's been a pleasure if you have ideas on what how we can make circuit python days deep dive next week special let me know check out the python subreddit for information about the am a that will do next week and if you want to support me go support ate a fruit by going to ate a fruit dot com purchasing stuff there they pay me to flounder around and not fix any bugs that may or may not exist um so uh thank you everybody for that uh if you want to chat with me or you have ideas about the circuit python day stuff you can go to the url adafru.it slash discord to join uh there and you can at me at at ten new uh there um usually deep dives are more successful but they're always include all these tangents i do them fridays at two p.m. pacific next week will be friday and two two p.m. pacific as well uh thank you for hanging out um and uh it's been a pleasure and i'll i can't pet the cat because he's not here so i'll just tell us see you next week for circuit python day have a great weekend


Let's take another look at an example of an integral involving both tangent and secant here We saw in a previous example that if your power of secant is an even number You can borrow two of those secants to be your du. You said u to be tangent of x and you can do a u substitution What I want to do is show you what you can do if your Power of secant is in fact odd if your power is odd The idea is you don't want to use this one secant squared what you want to do And the reason for that is if you have an even amount you take away To you'll be left with an even amount and you can then convert secants into tangents using the Pythagorean identity If you have an odd amount and you borrow to you'll have an odd amount And then you can't do the Pythagorean identity to even there on the other hand if you use if you set u to be tangent secant I should say du to be tangent secant. We take du to be a tangent x secant x dx Then in that situation you should set u equal to be u to be Spacing out here secant of x what would happen in the previous situation So let's kind of break it up into smaller pieces the tangent to the fifth secant to the seventh Well, what we're going to do is we're going to borrow one of this tangents and one of the secants So we get tangent to the fourth theta We're going to get secant to the sixth theta and then we have this tangent theta secant theta d theta Right here And so notice this tangent secant d theta. We're setting this aside to be our du I noticed I was writing x earlier with our variables. That was mistake on my part. They should be theta's So the tangent theta secant theta d theta will become our d theta What do you do with the rest of it? Well secant to the sixth should be fairly clear secant to the sixth should just be u to the sixth What about the tangent to the fourth in that situation? Well utilizing the Pythagorean identity above here notice that tangent squared I should say in this case tangent squared theta is equal to secant squared theta minus one Making that substitution tangent to the fourth is going to become all tangent to the fourth is just tangent squared squared So we're going to get a secant squared theta minus one.  Don't be overwhelmed if the power seems so big. Oh, no u to the tenth. Oh dear Well for the power rule makes really no difference I mean if our power is one million then we integrate the power will become million and one So just just employ the power rule as you've seen with the antiderivatives in the past We would end up with one 11th u to the 11th minus two ninths u to the ninth plus one seventh u to the seventh plus a constant and now replace the u with secant of theta Which was our original substitution there in which case we get one 11th Not u secant to the 11th theta Then we get minus two ninths secant to the ninth theta plus one seventh one seventh secant to the seventh theta plus a constant and here's our antiderivative So we've now seen in this example plus the previous one if the power of secant is even what to do In this one I have to add a little bit of a caveat, right? We I said this is what we do when secant has power is odd, but it also only works if tangent's power is also odd It can get a little bit funky otherwise But if you have an odd number of tangents and an odd number of secants this this will work out very well for us