Boyfriend can’t stay hard

I have been with my boyfriend for almost 5 months. We are both 17, which is why I’m kind of skeptical about posting this.

My boyfriend and I do foreplay (hj/bj) about once every week or two. The first several times we did stuff like this, he was able to finish. But, recently, he’s been losing his hard after 15 minutes or so. When we try to have sex and he puts on a condom, this happens too, even after a substantial amount of foreplay. When it comes to actual sex I can understand why this happens, since condoms are restricting and I am his first girlfriend, so he gets a bit nervous (even though I try to decrease that anxiety as much as possible).

That being said, I don’t know why he’s losing his hard WITHOUT a condom. We’ve done it many times and he was able to finish. I know that he cares about me a lot and has genuine feelings towards me. He gets so upset with himself when this happens, and I comfort him as much as possible because I hate seeing him like this. He makes me so happy, and I know that this aspect of our relationship isn’t everything, but sometimes my mind wanders and I feel like I’m not doing a good enough job, although he tells me otherwise.

I think some of it might be because recently he’s smoking more weed than usual and weed can cause ED if smoked in large amounts. He doesn’t think so. I don’t know. It’s just bothering me. Please give me advice